{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Pandas\n",
    "\n",
    "Pandas是基于Numpy的专业数据分析工具，可以灵活高效的处理各种数据集，也是我们后期分析案例的神器。它提供了两种类型的数据结构，分别是DataFrame和Series，我们可以简单的把DataFrame理解为Excel里面的一张表，而Series就是表中的某一列，后面学习和用到的所有Pandas操作，都是基于这些表和列进行的操作。\n",
    "\n",
    "这里有一点需要强调，Pandas和Excel、SQL相比，只是调用和处理数据的方式变了，核心都是对源数据进行一系列的处理，在正式处理之前，更重要的是谋定而后动，明确分析的意义，理清分析思路之后再处理和分析数据，往往事半功倍。\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 创建、读取和存储\n",
    "\n",
    "在Pandas中我们想要构造一张表，第一步一定是先导入我们的库——import pandas as pd\n",
    "\n",
    "构造DataFrame最常用的方式是**字典+列表**，语句很简单，先是字典外括，然后依次打出每一列标题及其对应的列值（此处一定要用列表），这里列的顺序并不重要："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Yes</th>\n",
       "      <th>No</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>50</td>\n",
       "      <td>131</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>21</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Yes   No\n",
       "0   50  131\n",
       "1   21    2"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "df1 = pd.DataFrame({'Yes': [50, 21], 'No': [131, 2]})\n",
    "df2 = pd.DataFrame({'Bob': ['I liked it.', 'It was awful.'], 'Sue': ['Pretty good.', 'Bland.']})\n",
    "df1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "我们使用pd.DataFrame构造函数来生成这些DataFrame对象。创建新对象的语法是初始化一个字典，其键是列名（本例中为Bob和Sue），其值是条目列表。 这是构建新DataFrame的标准方法，也是你最容易遇到的方法。\n",
    "\n",
    "字典列表的构造函数为列标签分配值，但只使用0（0,1,2,3，...）的递增计数作为行标签。 有时候这没关系，但我们经常会想要自己分配这些行标签。\n",
    "\n",
    "DataFrame中使用的行标签列表称为索引。 我们可以在构造函数中使用索引参数为其赋值：\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Bob</th>\n",
       "      <th>Sue</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Product A</th>\n",
       "      <td>I liked it.</td>\n",
       "      <td>Pretty good.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Product B</th>\n",
       "      <td>It was awful.</td>\n",
       "      <td>Bland.</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                     Bob           Sue\n",
       "Product A    I liked it.  Pretty good.\n",
       "Product B  It was awful.        Bland."
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.DataFrame({'Bob': ['I liked it.', 'It was awful.'], \n",
    "              'Sue': ['Pretty good.', 'Bland.']},\n",
    "             index=['Product A', 'Product B'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "相比之下，Series是一系列数据值。 如果DataFrame是表，则Series是列表。 事实上，你可以创建一个Series只有一个列表："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    1\n",
       "1    2\n",
       "2    3\n",
       "3    4\n",
       "4    5\n",
       "dtype: int64"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p = pd.Series([1, 2, 3, 4, 5])\n",
    "p"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Series本质上是DataFrame的单个列。 因此，你可以使用索引参数以与之前相同的方式为Series分配列值。 但是，Series没有列名，它只有一个总名称："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2015 Sales    30\n",
       "2016 Sales    35\n",
       "2017 Sales    40\n",
       "Name: Product A, dtype: int64"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Series([30, 35, 40], index=['2015 Sales', '2016 Sales', '2017 Sales'], name='Product A')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Series和DataFrame密切相关。 将DataFrame视为实际上只是一堆Series**粘合在一起**是有帮助的。\n",
    "\n",
    "#### 读取数据\n",
    "\n",
    "能够手动创建DataFrame和Series非常方便。 但是，在大多数情况下，我们实际上不会手动创建自己的数据，我们将使用已经存在的数据。\n",
    "\n",
    "数据可以以多种不同的形式和格式存储。 到目前为止，其中最基本的是简单的**CSV文件**，以及**xls文件**。\n",
    "\n",
    "*你可以在本repo中下载课件中提到的文件，或者使用Github Desktop来下载所有的文件到本地（推荐）*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv('stock_data.csv', index_col=0)\n",
    "#df = pd.read_excel(\"stock_data.xls\", sheet_name='price')\n",
    "#df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 存储数据\n",
    "\n",
    "将数据写入文件通常比从一个文件中读取数据更容易，因为pandas会为你处理转换的麻烦。\n",
    "\n",
    "我们将再次使用CSV文件。 read_csv（读取我们的数据）的反义词是to_csv，写入它。 使用CSV文件很简单。 要写回Excel文件，需要再次使用to_excel和sheet_name。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "df.to_csv('stock_data_head.csv')\n",
    "#df.to_excel('stock_data_head.xls', sheet_name='price')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**统计信息概览**\n",
    "\n",
    "快速计算数值型数据的关键统计指标，像平均数、中位数、标准差等等"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>trade_date</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>7.370000e+02</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "      <td>737.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>2.018581e+07</td>\n",
       "      <td>11.002198</td>\n",
       "      <td>11.244084</td>\n",
       "      <td>10.789118</td>\n",
       "      <td>11.017123</td>\n",
       "      <td>11.010475</td>\n",
       "      <td>0.006649</td>\n",
       "      <td>0.093007</td>\n",
       "      <td>90858.378725</td>\n",
       "      <td>106162.360978</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>9.637208e+03</td>\n",
       "      <td>1.889141</td>\n",
       "      <td>1.976465</td>\n",
       "      <td>1.827325</td>\n",
       "      <td>1.908847</td>\n",
       "      <td>1.899236</td>\n",
       "      <td>0.343773</td>\n",
       "      <td>2.983851</td>\n",
       "      <td>70279.618800</td>\n",
       "      <td>96928.400735</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>2.017070e+07</td>\n",
       "      <td>7.770000</td>\n",
       "      <td>7.950000</td>\n",
       "      <td>7.750000</td>\n",
       "      <td>7.770000</td>\n",
       "      <td>7.770000</td>\n",
       "      <td>-1.440000</td>\n",
       "      <td>-10.018600</td>\n",
       "      <td>7829.000000</td>\n",
       "      <td>7891.632000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>2.018040e+07</td>\n",
       "      <td>9.360000</td>\n",
       "      <td>9.560000</td>\n",
       "      <td>9.210000</td>\n",
       "      <td>9.360000</td>\n",
       "      <td>9.360000</td>\n",
       "      <td>-0.170000</td>\n",
       "      <td>-1.530000</td>\n",
       "      <td>45415.130000</td>\n",
       "      <td>46596.916000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>2.019010e+07</td>\n",
       "      <td>10.890000</td>\n",
       "      <td>11.080000</td>\n",
       "      <td>10.610000</td>\n",
       "      <td>10.850000</td>\n",
       "      <td>10.850000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>68256.230000</td>\n",
       "      <td>75595.631000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>2.019102e+07</td>\n",
       "      <td>12.280000</td>\n",
       "      <td>12.560000</td>\n",
       "      <td>12.020000</td>\n",
       "      <td>12.290000</td>\n",
       "      <td>12.280000</td>\n",
       "      <td>0.160000</td>\n",
       "      <td>1.414300</td>\n",
       "      <td>110826.680000</td>\n",
       "      <td>130335.838000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>2.020072e+07</td>\n",
       "      <td>17.800000</td>\n",
       "      <td>18.180000</td>\n",
       "      <td>16.900000</td>\n",
       "      <td>17.950000</td>\n",
       "      <td>17.950000</td>\n",
       "      <td>1.540000</td>\n",
       "      <td>10.043700</td>\n",
       "      <td>543655.080000</td>\n",
       "      <td>814316.938000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         trade_date        open        high         low       close  \\\n",
       "count  7.370000e+02  737.000000  737.000000  737.000000  737.000000   \n",
       "mean   2.018581e+07   11.002198   11.244084   10.789118   11.017123   \n",
       "std    9.637208e+03    1.889141    1.976465    1.827325    1.908847   \n",
       "min    2.017070e+07    7.770000    7.950000    7.750000    7.770000   \n",
       "25%    2.018040e+07    9.360000    9.560000    9.210000    9.360000   \n",
       "50%    2.019010e+07   10.890000   11.080000   10.610000   10.850000   \n",
       "75%    2.019102e+07   12.280000   12.560000   12.020000   12.290000   \n",
       "max    2.020072e+07   17.800000   18.180000   16.900000   17.950000   \n",
       "\n",
       "        pre_close      change     pct_chg            vol         amount  \n",
       "count  737.000000  737.000000  737.000000     737.000000     737.000000  \n",
       "mean    11.010475    0.006649    0.093007   90858.378725  106162.360978  \n",
       "std      1.899236    0.343773    2.983851   70279.618800   96928.400735  \n",
       "min      7.770000   -1.440000  -10.018600    7829.000000    7891.632000  \n",
       "25%      9.360000   -0.170000   -1.530000   45415.130000   46596.916000  \n",
       "50%     10.850000    0.000000    0.000000   68256.230000   75595.631000  \n",
       "75%     12.280000    0.160000    1.414300  110826.680000  130335.838000  \n",
       "max     17.950000    1.540000   10.043700  543655.080000  814316.938000  "
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**列的基本处理方式**\n",
    "\n",
    "这里，我们采用SQL四大法宝的逻辑来简单梳理针对列的基本处理方式——增、删、选、改。\n",
    "\n",
    "温馨提示：使用Pandas时，尽量避免用行或者EXCEL操作单元格的思维来处理数据，要逐渐养成一种列向思维，每一列是同宗同源。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**增**  增加一列，用df['新列名'] = 新列值的形式，在原数据基础上赋值即可"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "737"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['new_col'] = range(1, len(df)+1)\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**删**  我们用drop函数制定删除对应的列，axis = 1表示针对列的操作，inplace为True，则直接在源数据上进行修改，否则源数据会保持原样"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>trade_date</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200724</td>\n",
       "      <td>16.80</td>\n",
       "      <td>16.81</td>\n",
       "      <td>15.56</td>\n",
       "      <td>16.20</td>\n",
       "      <td>16.51</td>\n",
       "      <td>-0.31</td>\n",
       "      <td>-1.8776</td>\n",
       "      <td>285487.23</td>\n",
       "      <td>460908.718</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200723</td>\n",
       "      <td>17.80</td>\n",
       "      <td>18.07</td>\n",
       "      <td>16.24</td>\n",
       "      <td>16.51</td>\n",
       "      <td>17.95</td>\n",
       "      <td>-1.44</td>\n",
       "      <td>-8.0223</td>\n",
       "      <td>332693.07</td>\n",
       "      <td>561431.842</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200722</td>\n",
       "      <td>17.12</td>\n",
       "      <td>18.18</td>\n",
       "      <td>16.90</td>\n",
       "      <td>17.95</td>\n",
       "      <td>17.21</td>\n",
       "      <td>0.74</td>\n",
       "      <td>4.2998</td>\n",
       "      <td>184201.74</td>\n",
       "      <td>325956.565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200721</td>\n",
       "      <td>17.20</td>\n",
       "      <td>17.87</td>\n",
       "      <td>16.77</td>\n",
       "      <td>17.21</td>\n",
       "      <td>16.97</td>\n",
       "      <td>0.24</td>\n",
       "      <td>1.4143</td>\n",
       "      <td>226621.76</td>\n",
       "      <td>390465.486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200720</td>\n",
       "      <td>15.80</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.50</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>1.54</td>\n",
       "      <td>9.9806</td>\n",
       "      <td>320102.62</td>\n",
       "      <td>530137.992</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200717</td>\n",
       "      <td>14.86</td>\n",
       "      <td>15.80</td>\n",
       "      <td>14.80</td>\n",
       "      <td>15.43</td>\n",
       "      <td>14.87</td>\n",
       "      <td>0.56</td>\n",
       "      <td>3.7660</td>\n",
       "      <td>199292.16</td>\n",
       "      <td>305435.914</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200716</td>\n",
       "      <td>14.95</td>\n",
       "      <td>16.10</td>\n",
       "      <td>14.83</td>\n",
       "      <td>14.87</td>\n",
       "      <td>15.23</td>\n",
       "      <td>-0.36</td>\n",
       "      <td>-2.3638</td>\n",
       "      <td>229290.80</td>\n",
       "      <td>353556.481</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200715</td>\n",
       "      <td>15.40</td>\n",
       "      <td>15.60</td>\n",
       "      <td>14.80</td>\n",
       "      <td>15.23</td>\n",
       "      <td>15.20</td>\n",
       "      <td>0.03</td>\n",
       "      <td>0.1974</td>\n",
       "      <td>213356.58</td>\n",
       "      <td>323258.908</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200714</td>\n",
       "      <td>15.21</td>\n",
       "      <td>16.16</td>\n",
       "      <td>14.68</td>\n",
       "      <td>15.20</td>\n",
       "      <td>15.32</td>\n",
       "      <td>-0.12</td>\n",
       "      <td>-0.7833</td>\n",
       "      <td>222269.86</td>\n",
       "      <td>340759.697</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200713</td>\n",
       "      <td>14.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>14.75</td>\n",
       "      <td>15.32</td>\n",
       "      <td>15.12</td>\n",
       "      <td>0.20</td>\n",
       "      <td>1.3228</td>\n",
       "      <td>184452.45</td>\n",
       "      <td>278886.698</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200710</td>\n",
       "      <td>15.63</td>\n",
       "      <td>15.68</td>\n",
       "      <td>14.60</td>\n",
       "      <td>15.12</td>\n",
       "      <td>15.50</td>\n",
       "      <td>-0.38</td>\n",
       "      <td>-2.4516</td>\n",
       "      <td>218210.43</td>\n",
       "      <td>329484.318</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200709</td>\n",
       "      <td>14.20</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.01</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.09</td>\n",
       "      <td>1.41</td>\n",
       "      <td>10.0071</td>\n",
       "      <td>267772.91</td>\n",
       "      <td>395199.486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200708</td>\n",
       "      <td>13.03</td>\n",
       "      <td>14.40</td>\n",
       "      <td>13.03</td>\n",
       "      <td>14.09</td>\n",
       "      <td>13.09</td>\n",
       "      <td>1.00</td>\n",
       "      <td>7.6394</td>\n",
       "      <td>293345.03</td>\n",
       "      <td>407198.381</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200707</td>\n",
       "      <td>13.05</td>\n",
       "      <td>13.55</td>\n",
       "      <td>12.92</td>\n",
       "      <td>13.09</td>\n",
       "      <td>13.00</td>\n",
       "      <td>0.09</td>\n",
       "      <td>0.6923</td>\n",
       "      <td>184150.75</td>\n",
       "      <td>243893.075</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200706</td>\n",
       "      <td>12.97</td>\n",
       "      <td>13.16</td>\n",
       "      <td>12.78</td>\n",
       "      <td>13.00</td>\n",
       "      <td>12.90</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.7752</td>\n",
       "      <td>241303.32</td>\n",
       "      <td>313084.240</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200703</td>\n",
       "      <td>12.39</td>\n",
       "      <td>13.10</td>\n",
       "      <td>12.30</td>\n",
       "      <td>12.90</td>\n",
       "      <td>12.35</td>\n",
       "      <td>0.55</td>\n",
       "      <td>4.4534</td>\n",
       "      <td>218369.18</td>\n",
       "      <td>278710.530</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200702</td>\n",
       "      <td>12.37</td>\n",
       "      <td>12.48</td>\n",
       "      <td>12.05</td>\n",
       "      <td>12.35</td>\n",
       "      <td>12.38</td>\n",
       "      <td>-0.03</td>\n",
       "      <td>-0.2423</td>\n",
       "      <td>164501.68</td>\n",
       "      <td>201440.634</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200701</td>\n",
       "      <td>11.95</td>\n",
       "      <td>12.65</td>\n",
       "      <td>11.80</td>\n",
       "      <td>12.38</td>\n",
       "      <td>11.96</td>\n",
       "      <td>0.42</td>\n",
       "      <td>3.5117</td>\n",
       "      <td>228877.17</td>\n",
       "      <td>280866.551</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200630</td>\n",
       "      <td>11.62</td>\n",
       "      <td>12.15</td>\n",
       "      <td>11.51</td>\n",
       "      <td>11.96</td>\n",
       "      <td>11.58</td>\n",
       "      <td>0.38</td>\n",
       "      <td>3.2815</td>\n",
       "      <td>192286.30</td>\n",
       "      <td>228599.446</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200629</td>\n",
       "      <td>11.17</td>\n",
       "      <td>11.77</td>\n",
       "      <td>10.96</td>\n",
       "      <td>11.58</td>\n",
       "      <td>11.19</td>\n",
       "      <td>0.39</td>\n",
       "      <td>3.4853</td>\n",
       "      <td>207979.77</td>\n",
       "      <td>237171.977</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200624</td>\n",
       "      <td>11.32</td>\n",
       "      <td>11.41</td>\n",
       "      <td>11.08</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.35</td>\n",
       "      <td>-0.16</td>\n",
       "      <td>-1.4097</td>\n",
       "      <td>124793.19</td>\n",
       "      <td>140215.789</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200623</td>\n",
       "      <td>11.09</td>\n",
       "      <td>11.72</td>\n",
       "      <td>11.03</td>\n",
       "      <td>11.35</td>\n",
       "      <td>11.08</td>\n",
       "      <td>0.27</td>\n",
       "      <td>2.4368</td>\n",
       "      <td>223595.75</td>\n",
       "      <td>256107.121</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200622</td>\n",
       "      <td>11.10</td>\n",
       "      <td>11.31</td>\n",
       "      <td>10.93</td>\n",
       "      <td>11.08</td>\n",
       "      <td>11.05</td>\n",
       "      <td>0.03</td>\n",
       "      <td>0.2715</td>\n",
       "      <td>145578.40</td>\n",
       "      <td>161746.863</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200619</td>\n",
       "      <td>11.15</td>\n",
       "      <td>11.20</td>\n",
       "      <td>10.93</td>\n",
       "      <td>11.05</td>\n",
       "      <td>11.05</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>113959.89</td>\n",
       "      <td>125997.534</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200618</td>\n",
       "      <td>11.22</td>\n",
       "      <td>11.39</td>\n",
       "      <td>11.00</td>\n",
       "      <td>11.05</td>\n",
       "      <td>11.33</td>\n",
       "      <td>-0.28</td>\n",
       "      <td>-2.4713</td>\n",
       "      <td>150478.58</td>\n",
       "      <td>168049.284</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200617</td>\n",
       "      <td>11.40</td>\n",
       "      <td>11.69</td>\n",
       "      <td>11.10</td>\n",
       "      <td>11.33</td>\n",
       "      <td>10.96</td>\n",
       "      <td>0.37</td>\n",
       "      <td>3.3759</td>\n",
       "      <td>278214.10</td>\n",
       "      <td>313691.260</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200616</td>\n",
       "      <td>10.09</td>\n",
       "      <td>10.96</td>\n",
       "      <td>10.05</td>\n",
       "      <td>10.96</td>\n",
       "      <td>9.96</td>\n",
       "      <td>1.00</td>\n",
       "      <td>10.0402</td>\n",
       "      <td>177673.09</td>\n",
       "      <td>188478.610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200615</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.37</td>\n",
       "      <td>9.95</td>\n",
       "      <td>9.96</td>\n",
       "      <td>10.24</td>\n",
       "      <td>-0.28</td>\n",
       "      <td>-2.7344</td>\n",
       "      <td>131237.86</td>\n",
       "      <td>133263.669</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200612</td>\n",
       "      <td>10.20</td>\n",
       "      <td>10.38</td>\n",
       "      <td>10.09</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.41</td>\n",
       "      <td>-0.17</td>\n",
       "      <td>-1.6330</td>\n",
       "      <td>80052.00</td>\n",
       "      <td>81944.184</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200611</td>\n",
       "      <td>10.50</td>\n",
       "      <td>10.69</td>\n",
       "      <td>10.34</td>\n",
       "      <td>10.41</td>\n",
       "      <td>10.52</td>\n",
       "      <td>-0.11</td>\n",
       "      <td>-1.0456</td>\n",
       "      <td>73533.43</td>\n",
       "      <td>77291.533</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>707</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170811</td>\n",
       "      <td>12.20</td>\n",
       "      <td>12.68</td>\n",
       "      <td>12.08</td>\n",
       "      <td>12.11</td>\n",
       "      <td>12.40</td>\n",
       "      <td>-0.29</td>\n",
       "      <td>-2.3400</td>\n",
       "      <td>128648.45</td>\n",
       "      <td>158873.570</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>708</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170810</td>\n",
       "      <td>12.12</td>\n",
       "      <td>12.40</td>\n",
       "      <td>11.50</td>\n",
       "      <td>12.40</td>\n",
       "      <td>12.24</td>\n",
       "      <td>0.16</td>\n",
       "      <td>1.3100</td>\n",
       "      <td>146709.17</td>\n",
       "      <td>176845.683</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>709</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170809</td>\n",
       "      <td>11.91</td>\n",
       "      <td>12.50</td>\n",
       "      <td>11.91</td>\n",
       "      <td>12.24</td>\n",
       "      <td>11.86</td>\n",
       "      <td>0.38</td>\n",
       "      <td>3.2000</td>\n",
       "      <td>219338.05</td>\n",
       "      <td>269819.114</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>710</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170808</td>\n",
       "      <td>11.48</td>\n",
       "      <td>11.88</td>\n",
       "      <td>11.41</td>\n",
       "      <td>11.86</td>\n",
       "      <td>11.50</td>\n",
       "      <td>0.36</td>\n",
       "      <td>3.1300</td>\n",
       "      <td>88519.42</td>\n",
       "      <td>103280.902</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>711</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170807</td>\n",
       "      <td>11.43</td>\n",
       "      <td>11.71</td>\n",
       "      <td>11.43</td>\n",
       "      <td>11.50</td>\n",
       "      <td>11.55</td>\n",
       "      <td>-0.05</td>\n",
       "      <td>-0.4300</td>\n",
       "      <td>48891.15</td>\n",
       "      <td>56568.247</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>712</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170804</td>\n",
       "      <td>11.90</td>\n",
       "      <td>11.90</td>\n",
       "      <td>11.54</td>\n",
       "      <td>11.55</td>\n",
       "      <td>11.90</td>\n",
       "      <td>-0.35</td>\n",
       "      <td>-2.9400</td>\n",
       "      <td>82981.10</td>\n",
       "      <td>96903.331</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>713</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170803</td>\n",
       "      <td>11.59</td>\n",
       "      <td>11.97</td>\n",
       "      <td>11.45</td>\n",
       "      <td>11.90</td>\n",
       "      <td>11.78</td>\n",
       "      <td>0.12</td>\n",
       "      <td>1.0200</td>\n",
       "      <td>142621.06</td>\n",
       "      <td>167400.909</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>714</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170802</td>\n",
       "      <td>11.17</td>\n",
       "      <td>12.30</td>\n",
       "      <td>11.17</td>\n",
       "      <td>11.78</td>\n",
       "      <td>11.19</td>\n",
       "      <td>0.59</td>\n",
       "      <td>5.2700</td>\n",
       "      <td>199954.40</td>\n",
       "      <td>236128.395</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>715</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170801</td>\n",
       "      <td>11.02</td>\n",
       "      <td>11.26</td>\n",
       "      <td>11.02</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.15</td>\n",
       "      <td>0.04</td>\n",
       "      <td>0.3600</td>\n",
       "      <td>49487.00</td>\n",
       "      <td>55171.080</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>716</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170731</td>\n",
       "      <td>11.12</td>\n",
       "      <td>11.27</td>\n",
       "      <td>11.09</td>\n",
       "      <td>11.15</td>\n",
       "      <td>11.18</td>\n",
       "      <td>-0.03</td>\n",
       "      <td>-0.2700</td>\n",
       "      <td>58034.70</td>\n",
       "      <td>64747.384</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>717</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170728</td>\n",
       "      <td>11.30</td>\n",
       "      <td>11.49</td>\n",
       "      <td>11.17</td>\n",
       "      <td>11.18</td>\n",
       "      <td>11.41</td>\n",
       "      <td>-0.23</td>\n",
       "      <td>-2.0200</td>\n",
       "      <td>65969.35</td>\n",
       "      <td>74327.418</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>718</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170727</td>\n",
       "      <td>11.26</td>\n",
       "      <td>11.58</td>\n",
       "      <td>11.01</td>\n",
       "      <td>11.41</td>\n",
       "      <td>11.19</td>\n",
       "      <td>0.22</td>\n",
       "      <td>1.9700</td>\n",
       "      <td>114912.20</td>\n",
       "      <td>130409.432</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>719</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170726</td>\n",
       "      <td>11.18</td>\n",
       "      <td>11.27</td>\n",
       "      <td>11.08</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.29</td>\n",
       "      <td>-0.10</td>\n",
       "      <td>-0.8900</td>\n",
       "      <td>64690.43</td>\n",
       "      <td>72190.146</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>720</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170725</td>\n",
       "      <td>11.34</td>\n",
       "      <td>11.42</td>\n",
       "      <td>11.06</td>\n",
       "      <td>11.29</td>\n",
       "      <td>11.52</td>\n",
       "      <td>-0.23</td>\n",
       "      <td>-2.0000</td>\n",
       "      <td>110796.27</td>\n",
       "      <td>124175.062</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>721</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170724</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.88</td>\n",
       "      <td>11.11</td>\n",
       "      <td>11.52</td>\n",
       "      <td>11.12</td>\n",
       "      <td>0.40</td>\n",
       "      <td>3.6000</td>\n",
       "      <td>225583.50</td>\n",
       "      <td>259010.552</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>722</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170721</td>\n",
       "      <td>10.30</td>\n",
       "      <td>11.12</td>\n",
       "      <td>10.28</td>\n",
       "      <td>11.12</td>\n",
       "      <td>10.11</td>\n",
       "      <td>1.01</td>\n",
       "      <td>9.9900</td>\n",
       "      <td>161723.79</td>\n",
       "      <td>177758.596</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>723</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170720</td>\n",
       "      <td>10.05</td>\n",
       "      <td>10.20</td>\n",
       "      <td>9.99</td>\n",
       "      <td>10.11</td>\n",
       "      <td>10.06</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.5000</td>\n",
       "      <td>31004.69</td>\n",
       "      <td>31373.829</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>724</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170719</td>\n",
       "      <td>9.97</td>\n",
       "      <td>10.06</td>\n",
       "      <td>9.88</td>\n",
       "      <td>10.06</td>\n",
       "      <td>9.98</td>\n",
       "      <td>0.08</td>\n",
       "      <td>0.8000</td>\n",
       "      <td>26258.85</td>\n",
       "      <td>26217.149</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>725</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170718</td>\n",
       "      <td>9.94</td>\n",
       "      <td>9.99</td>\n",
       "      <td>9.80</td>\n",
       "      <td>9.98</td>\n",
       "      <td>9.84</td>\n",
       "      <td>0.14</td>\n",
       "      <td>1.4200</td>\n",
       "      <td>34114.27</td>\n",
       "      <td>33835.607</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>726</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170717</td>\n",
       "      <td>10.63</td>\n",
       "      <td>10.63</td>\n",
       "      <td>9.71</td>\n",
       "      <td>9.84</td>\n",
       "      <td>10.67</td>\n",
       "      <td>-0.83</td>\n",
       "      <td>-7.7800</td>\n",
       "      <td>63451.74</td>\n",
       "      <td>63665.201</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>727</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170714</td>\n",
       "      <td>10.66</td>\n",
       "      <td>10.75</td>\n",
       "      <td>10.56</td>\n",
       "      <td>10.67</td>\n",
       "      <td>10.66</td>\n",
       "      <td>0.01</td>\n",
       "      <td>0.0900</td>\n",
       "      <td>33957.00</td>\n",
       "      <td>36189.361</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>728</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170713</td>\n",
       "      <td>10.72</td>\n",
       "      <td>10.75</td>\n",
       "      <td>10.59</td>\n",
       "      <td>10.66</td>\n",
       "      <td>10.77</td>\n",
       "      <td>-0.11</td>\n",
       "      <td>-1.0200</td>\n",
       "      <td>30273.71</td>\n",
       "      <td>32311.916</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>729</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170712</td>\n",
       "      <td>10.95</td>\n",
       "      <td>11.03</td>\n",
       "      <td>10.45</td>\n",
       "      <td>10.77</td>\n",
       "      <td>10.96</td>\n",
       "      <td>-0.19</td>\n",
       "      <td>-1.7300</td>\n",
       "      <td>64813.01</td>\n",
       "      <td>68976.373</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>730</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170711</td>\n",
       "      <td>11.04</td>\n",
       "      <td>11.14</td>\n",
       "      <td>10.93</td>\n",
       "      <td>10.96</td>\n",
       "      <td>11.02</td>\n",
       "      <td>-0.06</td>\n",
       "      <td>-0.5400</td>\n",
       "      <td>43952.33</td>\n",
       "      <td>48403.254</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>731</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170710</td>\n",
       "      <td>11.22</td>\n",
       "      <td>11.26</td>\n",
       "      <td>11.00</td>\n",
       "      <td>11.02</td>\n",
       "      <td>11.28</td>\n",
       "      <td>-0.26</td>\n",
       "      <td>-2.3100</td>\n",
       "      <td>62700.04</td>\n",
       "      <td>69415.697</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>732</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170707</td>\n",
       "      <td>11.36</td>\n",
       "      <td>11.43</td>\n",
       "      <td>11.22</td>\n",
       "      <td>11.28</td>\n",
       "      <td>11.43</td>\n",
       "      <td>-0.15</td>\n",
       "      <td>-1.3100</td>\n",
       "      <td>69776.46</td>\n",
       "      <td>78795.099</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>733</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170706</td>\n",
       "      <td>11.49</td>\n",
       "      <td>11.53</td>\n",
       "      <td>11.36</td>\n",
       "      <td>11.43</td>\n",
       "      <td>11.53</td>\n",
       "      <td>-0.10</td>\n",
       "      <td>-0.8700</td>\n",
       "      <td>51529.62</td>\n",
       "      <td>58924.662</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>734</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170705</td>\n",
       "      <td>11.52</td>\n",
       "      <td>11.65</td>\n",
       "      <td>11.47</td>\n",
       "      <td>11.53</td>\n",
       "      <td>11.56</td>\n",
       "      <td>-0.03</td>\n",
       "      <td>-0.2600</td>\n",
       "      <td>50503.45</td>\n",
       "      <td>58339.668</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>735</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170704</td>\n",
       "      <td>11.50</td>\n",
       "      <td>11.68</td>\n",
       "      <td>11.45</td>\n",
       "      <td>11.56</td>\n",
       "      <td>11.50</td>\n",
       "      <td>0.06</td>\n",
       "      <td>0.5200</td>\n",
       "      <td>50820.01</td>\n",
       "      <td>58857.307</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>736</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170703</td>\n",
       "      <td>11.44</td>\n",
       "      <td>11.55</td>\n",
       "      <td>11.30</td>\n",
       "      <td>11.50</td>\n",
       "      <td>11.44</td>\n",
       "      <td>0.06</td>\n",
       "      <td>0.5200</td>\n",
       "      <td>41711.00</td>\n",
       "      <td>47616.602</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>737 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       ts_code  trade_date   open   high    low  close  pre_close  change  \\\n",
       "0    002747.SZ    20200724  16.80  16.81  15.56  16.20      16.51   -0.31   \n",
       "1    002747.SZ    20200723  17.80  18.07  16.24  16.51      17.95   -1.44   \n",
       "2    002747.SZ    20200722  17.12  18.18  16.90  17.95      17.21    0.74   \n",
       "3    002747.SZ    20200721  17.20  17.87  16.77  17.21      16.97    0.24   \n",
       "4    002747.SZ    20200720  15.80  16.97  15.50  16.97      15.43    1.54   \n",
       "5    002747.SZ    20200717  14.86  15.80  14.80  15.43      14.87    0.56   \n",
       "6    002747.SZ    20200716  14.95  16.10  14.83  14.87      15.23   -0.36   \n",
       "7    002747.SZ    20200715  15.40  15.60  14.80  15.23      15.20    0.03   \n",
       "8    002747.SZ    20200714  15.21  16.16  14.68  15.20      15.32   -0.12   \n",
       "9    002747.SZ    20200713  14.97  15.43  14.75  15.32      15.12    0.20   \n",
       "10   002747.SZ    20200710  15.63  15.68  14.60  15.12      15.50   -0.38   \n",
       "11   002747.SZ    20200709  14.20  15.50  14.01  15.50      14.09    1.41   \n",
       "12   002747.SZ    20200708  13.03  14.40  13.03  14.09      13.09    1.00   \n",
       "13   002747.SZ    20200707  13.05  13.55  12.92  13.09      13.00    0.09   \n",
       "14   002747.SZ    20200706  12.97  13.16  12.78  13.00      12.90    0.10   \n",
       "15   002747.SZ    20200703  12.39  13.10  12.30  12.90      12.35    0.55   \n",
       "16   002747.SZ    20200702  12.37  12.48  12.05  12.35      12.38   -0.03   \n",
       "17   002747.SZ    20200701  11.95  12.65  11.80  12.38      11.96    0.42   \n",
       "18   002747.SZ    20200630  11.62  12.15  11.51  11.96      11.58    0.38   \n",
       "19   002747.SZ    20200629  11.17  11.77  10.96  11.58      11.19    0.39   \n",
       "20   002747.SZ    20200624  11.32  11.41  11.08  11.19      11.35   -0.16   \n",
       "21   002747.SZ    20200623  11.09  11.72  11.03  11.35      11.08    0.27   \n",
       "22   002747.SZ    20200622  11.10  11.31  10.93  11.08      11.05    0.03   \n",
       "23   002747.SZ    20200619  11.15  11.20  10.93  11.05      11.05    0.00   \n",
       "24   002747.SZ    20200618  11.22  11.39  11.00  11.05      11.33   -0.28   \n",
       "25   002747.SZ    20200617  11.40  11.69  11.10  11.33      10.96    0.37   \n",
       "26   002747.SZ    20200616  10.09  10.96  10.05  10.96       9.96    1.00   \n",
       "27   002747.SZ    20200615  10.24  10.37   9.95   9.96      10.24   -0.28   \n",
       "28   002747.SZ    20200612  10.20  10.38  10.09  10.24      10.41   -0.17   \n",
       "29   002747.SZ    20200611  10.50  10.69  10.34  10.41      10.52   -0.11   \n",
       "..         ...         ...    ...    ...    ...    ...        ...     ...   \n",
       "707  002747.SZ    20170811  12.20  12.68  12.08  12.11      12.40   -0.29   \n",
       "708  002747.SZ    20170810  12.12  12.40  11.50  12.40      12.24    0.16   \n",
       "709  002747.SZ    20170809  11.91  12.50  11.91  12.24      11.86    0.38   \n",
       "710  002747.SZ    20170808  11.48  11.88  11.41  11.86      11.50    0.36   \n",
       "711  002747.SZ    20170807  11.43  11.71  11.43  11.50      11.55   -0.05   \n",
       "712  002747.SZ    20170804  11.90  11.90  11.54  11.55      11.90   -0.35   \n",
       "713  002747.SZ    20170803  11.59  11.97  11.45  11.90      11.78    0.12   \n",
       "714  002747.SZ    20170802  11.17  12.30  11.17  11.78      11.19    0.59   \n",
       "715  002747.SZ    20170801  11.02  11.26  11.02  11.19      11.15    0.04   \n",
       "716  002747.SZ    20170731  11.12  11.27  11.09  11.15      11.18   -0.03   \n",
       "717  002747.SZ    20170728  11.30  11.49  11.17  11.18      11.41   -0.23   \n",
       "718  002747.SZ    20170727  11.26  11.58  11.01  11.41      11.19    0.22   \n",
       "719  002747.SZ    20170726  11.18  11.27  11.08  11.19      11.29   -0.10   \n",
       "720  002747.SZ    20170725  11.34  11.42  11.06  11.29      11.52   -0.23   \n",
       "721  002747.SZ    20170724  11.19  11.88  11.11  11.52      11.12    0.40   \n",
       "722  002747.SZ    20170721  10.30  11.12  10.28  11.12      10.11    1.01   \n",
       "723  002747.SZ    20170720  10.05  10.20   9.99  10.11      10.06    0.05   \n",
       "724  002747.SZ    20170719   9.97  10.06   9.88  10.06       9.98    0.08   \n",
       "725  002747.SZ    20170718   9.94   9.99   9.80   9.98       9.84    0.14   \n",
       "726  002747.SZ    20170717  10.63  10.63   9.71   9.84      10.67   -0.83   \n",
       "727  002747.SZ    20170714  10.66  10.75  10.56  10.67      10.66    0.01   \n",
       "728  002747.SZ    20170713  10.72  10.75  10.59  10.66      10.77   -0.11   \n",
       "729  002747.SZ    20170712  10.95  11.03  10.45  10.77      10.96   -0.19   \n",
       "730  002747.SZ    20170711  11.04  11.14  10.93  10.96      11.02   -0.06   \n",
       "731  002747.SZ    20170710  11.22  11.26  11.00  11.02      11.28   -0.26   \n",
       "732  002747.SZ    20170707  11.36  11.43  11.22  11.28      11.43   -0.15   \n",
       "733  002747.SZ    20170706  11.49  11.53  11.36  11.43      11.53   -0.10   \n",
       "734  002747.SZ    20170705  11.52  11.65  11.47  11.53      11.56   -0.03   \n",
       "735  002747.SZ    20170704  11.50  11.68  11.45  11.56      11.50    0.06   \n",
       "736  002747.SZ    20170703  11.44  11.55  11.30  11.50      11.44    0.06   \n",
       "\n",
       "     pct_chg        vol      amount  \n",
       "0    -1.8776  285487.23  460908.718  \n",
       "1    -8.0223  332693.07  561431.842  \n",
       "2     4.2998  184201.74  325956.565  \n",
       "3     1.4143  226621.76  390465.486  \n",
       "4     9.9806  320102.62  530137.992  \n",
       "5     3.7660  199292.16  305435.914  \n",
       "6    -2.3638  229290.80  353556.481  \n",
       "7     0.1974  213356.58  323258.908  \n",
       "8    -0.7833  222269.86  340759.697  \n",
       "9     1.3228  184452.45  278886.698  \n",
       "10   -2.4516  218210.43  329484.318  \n",
       "11   10.0071  267772.91  395199.486  \n",
       "12    7.6394  293345.03  407198.381  \n",
       "13    0.6923  184150.75  243893.075  \n",
       "14    0.7752  241303.32  313084.240  \n",
       "15    4.4534  218369.18  278710.530  \n",
       "16   -0.2423  164501.68  201440.634  \n",
       "17    3.5117  228877.17  280866.551  \n",
       "18    3.2815  192286.30  228599.446  \n",
       "19    3.4853  207979.77  237171.977  \n",
       "20   -1.4097  124793.19  140215.789  \n",
       "21    2.4368  223595.75  256107.121  \n",
       "22    0.2715  145578.40  161746.863  \n",
       "23    0.0000  113959.89  125997.534  \n",
       "24   -2.4713  150478.58  168049.284  \n",
       "25    3.3759  278214.10  313691.260  \n",
       "26   10.0402  177673.09  188478.610  \n",
       "27   -2.7344  131237.86  133263.669  \n",
       "28   -1.6330   80052.00   81944.184  \n",
       "29   -1.0456   73533.43   77291.533  \n",
       "..       ...        ...         ...  \n",
       "707  -2.3400  128648.45  158873.570  \n",
       "708   1.3100  146709.17  176845.683  \n",
       "709   3.2000  219338.05  269819.114  \n",
       "710   3.1300   88519.42  103280.902  \n",
       "711  -0.4300   48891.15   56568.247  \n",
       "712  -2.9400   82981.10   96903.331  \n",
       "713   1.0200  142621.06  167400.909  \n",
       "714   5.2700  199954.40  236128.395  \n",
       "715   0.3600   49487.00   55171.080  \n",
       "716  -0.2700   58034.70   64747.384  \n",
       "717  -2.0200   65969.35   74327.418  \n",
       "718   1.9700  114912.20  130409.432  \n",
       "719  -0.8900   64690.43   72190.146  \n",
       "720  -2.0000  110796.27  124175.062  \n",
       "721   3.6000  225583.50  259010.552  \n",
       "722   9.9900  161723.79  177758.596  \n",
       "723   0.5000   31004.69   31373.829  \n",
       "724   0.8000   26258.85   26217.149  \n",
       "725   1.4200   34114.27   33835.607  \n",
       "726  -7.7800   63451.74   63665.201  \n",
       "727   0.0900   33957.00   36189.361  \n",
       "728  -1.0200   30273.71   32311.916  \n",
       "729  -1.7300   64813.01   68976.373  \n",
       "730  -0.5400   43952.33   48403.254  \n",
       "731  -2.3100   62700.04   69415.697  \n",
       "732  -1.3100   69776.46   78795.099  \n",
       "733  -0.8700   51529.62   58924.662  \n",
       "734  -0.2600   50503.45   58339.668  \n",
       "735   0.5200   50820.01   58857.307  \n",
       "736   0.5200   41711.00   47616.602  \n",
       "\n",
       "[737 rows x 11 columns]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.drop('new_col', axis = 1, inplace = True)\n",
    "#df.head()\n",
    "df2 = df\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "有人能帮我理解一下，在pandas、numpy、scipy三都当中axis参数的真实含义吗？\n",
    "\n",
    "投票最高的答案揭示了问题的本质：\n",
    "\n",
    "- 其实问题理解axis有问题，df.mean其实是在每一行上取所有列的均值，而不是保留每一列的均值。也许简单的来记就是axis=0代表往跨行（down)，而axis=1代表跨列（across)，作为方法动作的副词\n",
    "\n",
    "![](assets/axis.jpg)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**选** 想要选取某一列怎么办？df['列名']即可"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>16.80</td>\n",
       "      <td>16.81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>17.80</td>\n",
       "      <td>18.07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>17.12</td>\n",
       "      <td>18.18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>17.20</td>\n",
       "      <td>17.87</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>15.80</td>\n",
       "      <td>16.97</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>732</th>\n",
       "      <td>11.36</td>\n",
       "      <td>11.43</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>733</th>\n",
       "      <td>11.49</td>\n",
       "      <td>11.53</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>734</th>\n",
       "      <td>11.52</td>\n",
       "      <td>11.65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>735</th>\n",
       "      <td>11.50</td>\n",
       "      <td>11.68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>736</th>\n",
       "      <td>11.44</td>\n",
       "      <td>11.55</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>737 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      open   high\n",
       "0    16.80  16.81\n",
       "1    17.80  18.07\n",
       "2    17.12  18.18\n",
       "3    17.20  17.87\n",
       "4    15.80  16.97\n",
       "..     ...    ...\n",
       "732  11.36  11.43\n",
       "733  11.49  11.53\n",
       "734  11.52  11.65\n",
       "735  11.50  11.68\n",
       "736  11.44  11.55\n",
       "\n",
       "[737 rows x 2 columns]"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['ts_code']\n",
    "df[['open','high']]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**改**  简单的更改：df['旧列名'] =  某个值或者某列值，就完成了对原列数值的修改"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    116.80\n",
       "1    117.80\n",
       "2    117.12\n",
       "3    117.20\n",
       "4    115.80\n",
       "Name: open, dtype: float64"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['open'] = df['open'] + 100\n",
    "df['open'].head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**选（复杂索引）**  基于判断，输出布尔值，可以把这一列判断得到的值传入行参数位置，Pandas会默认返回结果为True的行（这里是索引从0到12的行），而丢掉结果为False的行"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0       True\n",
       "1       True\n",
       "2       True\n",
       "3       True\n",
       "4       True\n",
       "       ...  \n",
       "732    False\n",
       "733    False\n",
       "734    False\n",
       "735    False\n",
       "736    False\n",
       "Name: vol, Length: 737, dtype: bool"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 输出交易量大于平均交易量的数据\n",
    "df['vol'] > df['vol'].mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>trade_date</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200724</td>\n",
       "      <td>16.80</td>\n",
       "      <td>16.81</td>\n",
       "      <td>15.56</td>\n",
       "      <td>16.20</td>\n",
       "      <td>16.51</td>\n",
       "      <td>-0.31</td>\n",
       "      <td>-1.8776</td>\n",
       "      <td>285487.23</td>\n",
       "      <td>460908.718</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200723</td>\n",
       "      <td>17.80</td>\n",
       "      <td>18.07</td>\n",
       "      <td>16.24</td>\n",
       "      <td>16.51</td>\n",
       "      <td>17.95</td>\n",
       "      <td>-1.44</td>\n",
       "      <td>-8.0223</td>\n",
       "      <td>332693.07</td>\n",
       "      <td>561431.842</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200722</td>\n",
       "      <td>17.12</td>\n",
       "      <td>18.18</td>\n",
       "      <td>16.90</td>\n",
       "      <td>17.95</td>\n",
       "      <td>17.21</td>\n",
       "      <td>0.74</td>\n",
       "      <td>4.2998</td>\n",
       "      <td>184201.74</td>\n",
       "      <td>325956.565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200721</td>\n",
       "      <td>17.20</td>\n",
       "      <td>17.87</td>\n",
       "      <td>16.77</td>\n",
       "      <td>17.21</td>\n",
       "      <td>16.97</td>\n",
       "      <td>0.24</td>\n",
       "      <td>1.4143</td>\n",
       "      <td>226621.76</td>\n",
       "      <td>390465.486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200720</td>\n",
       "      <td>15.80</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.50</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>1.54</td>\n",
       "      <td>9.9806</td>\n",
       "      <td>320102.62</td>\n",
       "      <td>530137.992</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200717</td>\n",
       "      <td>14.86</td>\n",
       "      <td>15.80</td>\n",
       "      <td>14.80</td>\n",
       "      <td>15.43</td>\n",
       "      <td>14.87</td>\n",
       "      <td>0.56</td>\n",
       "      <td>3.7660</td>\n",
       "      <td>199292.16</td>\n",
       "      <td>305435.914</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200716</td>\n",
       "      <td>14.95</td>\n",
       "      <td>16.10</td>\n",
       "      <td>14.83</td>\n",
       "      <td>14.87</td>\n",
       "      <td>15.23</td>\n",
       "      <td>-0.36</td>\n",
       "      <td>-2.3638</td>\n",
       "      <td>229290.80</td>\n",
       "      <td>353556.481</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200715</td>\n",
       "      <td>15.40</td>\n",
       "      <td>15.60</td>\n",
       "      <td>14.80</td>\n",
       "      <td>15.23</td>\n",
       "      <td>15.20</td>\n",
       "      <td>0.03</td>\n",
       "      <td>0.1974</td>\n",
       "      <td>213356.58</td>\n",
       "      <td>323258.908</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200714</td>\n",
       "      <td>15.21</td>\n",
       "      <td>16.16</td>\n",
       "      <td>14.68</td>\n",
       "      <td>15.20</td>\n",
       "      <td>15.32</td>\n",
       "      <td>-0.12</td>\n",
       "      <td>-0.7833</td>\n",
       "      <td>222269.86</td>\n",
       "      <td>340759.697</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200713</td>\n",
       "      <td>14.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>14.75</td>\n",
       "      <td>15.32</td>\n",
       "      <td>15.12</td>\n",
       "      <td>0.20</td>\n",
       "      <td>1.3228</td>\n",
       "      <td>184452.45</td>\n",
       "      <td>278886.698</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200710</td>\n",
       "      <td>15.63</td>\n",
       "      <td>15.68</td>\n",
       "      <td>14.60</td>\n",
       "      <td>15.12</td>\n",
       "      <td>15.50</td>\n",
       "      <td>-0.38</td>\n",
       "      <td>-2.4516</td>\n",
       "      <td>218210.43</td>\n",
       "      <td>329484.318</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200709</td>\n",
       "      <td>14.20</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.01</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.09</td>\n",
       "      <td>1.41</td>\n",
       "      <td>10.0071</td>\n",
       "      <td>267772.91</td>\n",
       "      <td>395199.486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200708</td>\n",
       "      <td>13.03</td>\n",
       "      <td>14.40</td>\n",
       "      <td>13.03</td>\n",
       "      <td>14.09</td>\n",
       "      <td>13.09</td>\n",
       "      <td>1.00</td>\n",
       "      <td>7.6394</td>\n",
       "      <td>293345.03</td>\n",
       "      <td>407198.381</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200707</td>\n",
       "      <td>13.05</td>\n",
       "      <td>13.55</td>\n",
       "      <td>12.92</td>\n",
       "      <td>13.09</td>\n",
       "      <td>13.00</td>\n",
       "      <td>0.09</td>\n",
       "      <td>0.6923</td>\n",
       "      <td>184150.75</td>\n",
       "      <td>243893.075</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200706</td>\n",
       "      <td>12.97</td>\n",
       "      <td>13.16</td>\n",
       "      <td>12.78</td>\n",
       "      <td>13.00</td>\n",
       "      <td>12.90</td>\n",
       "      <td>0.10</td>\n",
       "      <td>0.7752</td>\n",
       "      <td>241303.32</td>\n",
       "      <td>313084.240</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200703</td>\n",
       "      <td>12.39</td>\n",
       "      <td>13.10</td>\n",
       "      <td>12.30</td>\n",
       "      <td>12.90</td>\n",
       "      <td>12.35</td>\n",
       "      <td>0.55</td>\n",
       "      <td>4.4534</td>\n",
       "      <td>218369.18</td>\n",
       "      <td>278710.530</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200702</td>\n",
       "      <td>12.37</td>\n",
       "      <td>12.48</td>\n",
       "      <td>12.05</td>\n",
       "      <td>12.35</td>\n",
       "      <td>12.38</td>\n",
       "      <td>-0.03</td>\n",
       "      <td>-0.2423</td>\n",
       "      <td>164501.68</td>\n",
       "      <td>201440.634</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200701</td>\n",
       "      <td>11.95</td>\n",
       "      <td>12.65</td>\n",
       "      <td>11.80</td>\n",
       "      <td>12.38</td>\n",
       "      <td>11.96</td>\n",
       "      <td>0.42</td>\n",
       "      <td>3.5117</td>\n",
       "      <td>228877.17</td>\n",
       "      <td>280866.551</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200630</td>\n",
       "      <td>11.62</td>\n",
       "      <td>12.15</td>\n",
       "      <td>11.51</td>\n",
       "      <td>11.96</td>\n",
       "      <td>11.58</td>\n",
       "      <td>0.38</td>\n",
       "      <td>3.2815</td>\n",
       "      <td>192286.30</td>\n",
       "      <td>228599.446</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200629</td>\n",
       "      <td>11.17</td>\n",
       "      <td>11.77</td>\n",
       "      <td>10.96</td>\n",
       "      <td>11.58</td>\n",
       "      <td>11.19</td>\n",
       "      <td>0.39</td>\n",
       "      <td>3.4853</td>\n",
       "      <td>207979.77</td>\n",
       "      <td>237171.977</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200624</td>\n",
       "      <td>11.32</td>\n",
       "      <td>11.41</td>\n",
       "      <td>11.08</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.35</td>\n",
       "      <td>-0.16</td>\n",
       "      <td>-1.4097</td>\n",
       "      <td>124793.19</td>\n",
       "      <td>140215.789</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200623</td>\n",
       "      <td>11.09</td>\n",
       "      <td>11.72</td>\n",
       "      <td>11.03</td>\n",
       "      <td>11.35</td>\n",
       "      <td>11.08</td>\n",
       "      <td>0.27</td>\n",
       "      <td>2.4368</td>\n",
       "      <td>223595.75</td>\n",
       "      <td>256107.121</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200622</td>\n",
       "      <td>11.10</td>\n",
       "      <td>11.31</td>\n",
       "      <td>10.93</td>\n",
       "      <td>11.08</td>\n",
       "      <td>11.05</td>\n",
       "      <td>0.03</td>\n",
       "      <td>0.2715</td>\n",
       "      <td>145578.40</td>\n",
       "      <td>161746.863</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200619</td>\n",
       "      <td>11.15</td>\n",
       "      <td>11.20</td>\n",
       "      <td>10.93</td>\n",
       "      <td>11.05</td>\n",
       "      <td>11.05</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.0000</td>\n",
       "      <td>113959.89</td>\n",
       "      <td>125997.534</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200618</td>\n",
       "      <td>11.22</td>\n",
       "      <td>11.39</td>\n",
       "      <td>11.00</td>\n",
       "      <td>11.05</td>\n",
       "      <td>11.33</td>\n",
       "      <td>-0.28</td>\n",
       "      <td>-2.4713</td>\n",
       "      <td>150478.58</td>\n",
       "      <td>168049.284</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200617</td>\n",
       "      <td>11.40</td>\n",
       "      <td>11.69</td>\n",
       "      <td>11.10</td>\n",
       "      <td>11.33</td>\n",
       "      <td>10.96</td>\n",
       "      <td>0.37</td>\n",
       "      <td>3.3759</td>\n",
       "      <td>278214.10</td>\n",
       "      <td>313691.260</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200616</td>\n",
       "      <td>10.09</td>\n",
       "      <td>10.96</td>\n",
       "      <td>10.05</td>\n",
       "      <td>10.96</td>\n",
       "      <td>9.96</td>\n",
       "      <td>1.00</td>\n",
       "      <td>10.0402</td>\n",
       "      <td>177673.09</td>\n",
       "      <td>188478.610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200615</td>\n",
       "      <td>10.24</td>\n",
       "      <td>10.37</td>\n",
       "      <td>9.95</td>\n",
       "      <td>9.96</td>\n",
       "      <td>10.24</td>\n",
       "      <td>-0.28</td>\n",
       "      <td>-2.7344</td>\n",
       "      <td>131237.86</td>\n",
       "      <td>133263.669</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200609</td>\n",
       "      <td>10.88</td>\n",
       "      <td>10.95</td>\n",
       "      <td>10.60</td>\n",
       "      <td>10.74</td>\n",
       "      <td>10.90</td>\n",
       "      <td>-0.16</td>\n",
       "      <td>-1.4679</td>\n",
       "      <td>107257.02</td>\n",
       "      <td>115350.037</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200608</td>\n",
       "      <td>11.03</td>\n",
       "      <td>11.23</td>\n",
       "      <td>10.84</td>\n",
       "      <td>10.90</td>\n",
       "      <td>10.98</td>\n",
       "      <td>-0.08</td>\n",
       "      <td>-0.7286</td>\n",
       "      <td>118986.02</td>\n",
       "      <td>130820.131</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>681</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170918</td>\n",
       "      <td>14.76</td>\n",
       "      <td>15.26</td>\n",
       "      <td>14.53</td>\n",
       "      <td>14.68</td>\n",
       "      <td>14.97</td>\n",
       "      <td>-0.29</td>\n",
       "      <td>-1.9400</td>\n",
       "      <td>153897.99</td>\n",
       "      <td>228707.483</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>682</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170915</td>\n",
       "      <td>14.58</td>\n",
       "      <td>15.14</td>\n",
       "      <td>14.36</td>\n",
       "      <td>14.97</td>\n",
       "      <td>14.81</td>\n",
       "      <td>0.16</td>\n",
       "      <td>1.0800</td>\n",
       "      <td>201289.19</td>\n",
       "      <td>297906.732</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>683</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170914</td>\n",
       "      <td>15.13</td>\n",
       "      <td>15.80</td>\n",
       "      <td>14.80</td>\n",
       "      <td>14.81</td>\n",
       "      <td>14.95</td>\n",
       "      <td>-0.14</td>\n",
       "      <td>-0.9400</td>\n",
       "      <td>353446.43</td>\n",
       "      <td>539255.175</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>684</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170913</td>\n",
       "      <td>14.49</td>\n",
       "      <td>15.06</td>\n",
       "      <td>14.00</td>\n",
       "      <td>14.95</td>\n",
       "      <td>14.70</td>\n",
       "      <td>0.25</td>\n",
       "      <td>1.7000</td>\n",
       "      <td>328431.65</td>\n",
       "      <td>476672.593</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>685</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170912</td>\n",
       "      <td>14.75</td>\n",
       "      <td>15.56</td>\n",
       "      <td>14.58</td>\n",
       "      <td>14.70</td>\n",
       "      <td>14.82</td>\n",
       "      <td>-0.12</td>\n",
       "      <td>-0.8100</td>\n",
       "      <td>543655.08</td>\n",
       "      <td>814316.938</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>686</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170911</td>\n",
       "      <td>13.50</td>\n",
       "      <td>14.82</td>\n",
       "      <td>13.37</td>\n",
       "      <td>14.82</td>\n",
       "      <td>13.47</td>\n",
       "      <td>1.35</td>\n",
       "      <td>10.0200</td>\n",
       "      <td>490574.54</td>\n",
       "      <td>708201.434</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>687</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170908</td>\n",
       "      <td>13.78</td>\n",
       "      <td>13.79</td>\n",
       "      <td>13.24</td>\n",
       "      <td>13.47</td>\n",
       "      <td>13.87</td>\n",
       "      <td>-0.40</td>\n",
       "      <td>-2.8800</td>\n",
       "      <td>251060.04</td>\n",
       "      <td>337836.218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>688</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170907</td>\n",
       "      <td>14.30</td>\n",
       "      <td>14.32</td>\n",
       "      <td>13.81</td>\n",
       "      <td>13.87</td>\n",
       "      <td>14.44</td>\n",
       "      <td>-0.57</td>\n",
       "      <td>-3.9500</td>\n",
       "      <td>245508.61</td>\n",
       "      <td>344740.766</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>689</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170906</td>\n",
       "      <td>13.96</td>\n",
       "      <td>14.74</td>\n",
       "      <td>13.88</td>\n",
       "      <td>14.44</td>\n",
       "      <td>14.24</td>\n",
       "      <td>0.20</td>\n",
       "      <td>1.4000</td>\n",
       "      <td>341862.55</td>\n",
       "      <td>491219.726</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>690</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170905</td>\n",
       "      <td>13.48</td>\n",
       "      <td>14.57</td>\n",
       "      <td>13.22</td>\n",
       "      <td>14.24</td>\n",
       "      <td>13.53</td>\n",
       "      <td>0.71</td>\n",
       "      <td>5.2500</td>\n",
       "      <td>409734.21</td>\n",
       "      <td>574570.382</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>691</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170904</td>\n",
       "      <td>12.22</td>\n",
       "      <td>13.53</td>\n",
       "      <td>12.22</td>\n",
       "      <td>13.53</td>\n",
       "      <td>12.30</td>\n",
       "      <td>1.23</td>\n",
       "      <td>10.0000</td>\n",
       "      <td>312931.88</td>\n",
       "      <td>409827.692</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>695</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170829</td>\n",
       "      <td>12.54</td>\n",
       "      <td>12.54</td>\n",
       "      <td>12.30</td>\n",
       "      <td>12.45</td>\n",
       "      <td>12.69</td>\n",
       "      <td>-0.24</td>\n",
       "      <td>-1.8900</td>\n",
       "      <td>94616.85</td>\n",
       "      <td>117154.873</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>696</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170828</td>\n",
       "      <td>12.52</td>\n",
       "      <td>12.89</td>\n",
       "      <td>12.52</td>\n",
       "      <td>12.69</td>\n",
       "      <td>12.47</td>\n",
       "      <td>0.22</td>\n",
       "      <td>1.7600</td>\n",
       "      <td>107939.73</td>\n",
       "      <td>137234.693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>698</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170824</td>\n",
       "      <td>12.83</td>\n",
       "      <td>12.86</td>\n",
       "      <td>12.20</td>\n",
       "      <td>12.48</td>\n",
       "      <td>12.84</td>\n",
       "      <td>-0.36</td>\n",
       "      <td>-2.8000</td>\n",
       "      <td>111538.10</td>\n",
       "      <td>138581.242</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>699</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170823</td>\n",
       "      <td>12.45</td>\n",
       "      <td>13.43</td>\n",
       "      <td>12.45</td>\n",
       "      <td>12.84</td>\n",
       "      <td>12.26</td>\n",
       "      <td>0.58</td>\n",
       "      <td>4.7300</td>\n",
       "      <td>188946.84</td>\n",
       "      <td>243652.628</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>700</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170822</td>\n",
       "      <td>12.80</td>\n",
       "      <td>12.85</td>\n",
       "      <td>12.20</td>\n",
       "      <td>12.26</td>\n",
       "      <td>12.74</td>\n",
       "      <td>-0.48</td>\n",
       "      <td>-3.7700</td>\n",
       "      <td>106203.76</td>\n",
       "      <td>132018.325</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>702</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170818</td>\n",
       "      <td>12.76</td>\n",
       "      <td>12.89</td>\n",
       "      <td>12.60</td>\n",
       "      <td>12.66</td>\n",
       "      <td>12.92</td>\n",
       "      <td>-0.26</td>\n",
       "      <td>-2.0100</td>\n",
       "      <td>103992.25</td>\n",
       "      <td>132189.295</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>703</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170817</td>\n",
       "      <td>12.28</td>\n",
       "      <td>13.56</td>\n",
       "      <td>12.18</td>\n",
       "      <td>12.92</td>\n",
       "      <td>12.38</td>\n",
       "      <td>0.54</td>\n",
       "      <td>4.3600</td>\n",
       "      <td>241490.81</td>\n",
       "      <td>309030.232</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>704</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170816</td>\n",
       "      <td>12.38</td>\n",
       "      <td>12.54</td>\n",
       "      <td>12.10</td>\n",
       "      <td>12.38</td>\n",
       "      <td>12.29</td>\n",
       "      <td>0.09</td>\n",
       "      <td>0.7300</td>\n",
       "      <td>92100.24</td>\n",
       "      <td>113470.570</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>705</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170815</td>\n",
       "      <td>12.44</td>\n",
       "      <td>12.67</td>\n",
       "      <td>12.16</td>\n",
       "      <td>12.29</td>\n",
       "      <td>12.47</td>\n",
       "      <td>-0.18</td>\n",
       "      <td>-1.4400</td>\n",
       "      <td>96385.67</td>\n",
       "      <td>118870.079</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>706</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170814</td>\n",
       "      <td>12.10</td>\n",
       "      <td>12.58</td>\n",
       "      <td>12.10</td>\n",
       "      <td>12.47</td>\n",
       "      <td>12.11</td>\n",
       "      <td>0.36</td>\n",
       "      <td>2.9700</td>\n",
       "      <td>115510.84</td>\n",
       "      <td>143132.278</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>707</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170811</td>\n",
       "      <td>12.20</td>\n",
       "      <td>12.68</td>\n",
       "      <td>12.08</td>\n",
       "      <td>12.11</td>\n",
       "      <td>12.40</td>\n",
       "      <td>-0.29</td>\n",
       "      <td>-2.3400</td>\n",
       "      <td>128648.45</td>\n",
       "      <td>158873.570</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>708</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170810</td>\n",
       "      <td>12.12</td>\n",
       "      <td>12.40</td>\n",
       "      <td>11.50</td>\n",
       "      <td>12.40</td>\n",
       "      <td>12.24</td>\n",
       "      <td>0.16</td>\n",
       "      <td>1.3100</td>\n",
       "      <td>146709.17</td>\n",
       "      <td>176845.683</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>709</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170809</td>\n",
       "      <td>11.91</td>\n",
       "      <td>12.50</td>\n",
       "      <td>11.91</td>\n",
       "      <td>12.24</td>\n",
       "      <td>11.86</td>\n",
       "      <td>0.38</td>\n",
       "      <td>3.2000</td>\n",
       "      <td>219338.05</td>\n",
       "      <td>269819.114</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>713</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170803</td>\n",
       "      <td>11.59</td>\n",
       "      <td>11.97</td>\n",
       "      <td>11.45</td>\n",
       "      <td>11.90</td>\n",
       "      <td>11.78</td>\n",
       "      <td>0.12</td>\n",
       "      <td>1.0200</td>\n",
       "      <td>142621.06</td>\n",
       "      <td>167400.909</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>714</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170802</td>\n",
       "      <td>11.17</td>\n",
       "      <td>12.30</td>\n",
       "      <td>11.17</td>\n",
       "      <td>11.78</td>\n",
       "      <td>11.19</td>\n",
       "      <td>0.59</td>\n",
       "      <td>5.2700</td>\n",
       "      <td>199954.40</td>\n",
       "      <td>236128.395</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>718</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170727</td>\n",
       "      <td>11.26</td>\n",
       "      <td>11.58</td>\n",
       "      <td>11.01</td>\n",
       "      <td>11.41</td>\n",
       "      <td>11.19</td>\n",
       "      <td>0.22</td>\n",
       "      <td>1.9700</td>\n",
       "      <td>114912.20</td>\n",
       "      <td>130409.432</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>720</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170725</td>\n",
       "      <td>11.34</td>\n",
       "      <td>11.42</td>\n",
       "      <td>11.06</td>\n",
       "      <td>11.29</td>\n",
       "      <td>11.52</td>\n",
       "      <td>-0.23</td>\n",
       "      <td>-2.0000</td>\n",
       "      <td>110796.27</td>\n",
       "      <td>124175.062</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>721</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170724</td>\n",
       "      <td>11.19</td>\n",
       "      <td>11.88</td>\n",
       "      <td>11.11</td>\n",
       "      <td>11.52</td>\n",
       "      <td>11.12</td>\n",
       "      <td>0.40</td>\n",
       "      <td>3.6000</td>\n",
       "      <td>225583.50</td>\n",
       "      <td>259010.552</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>722</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170721</td>\n",
       "      <td>10.30</td>\n",
       "      <td>11.12</td>\n",
       "      <td>10.28</td>\n",
       "      <td>11.12</td>\n",
       "      <td>10.11</td>\n",
       "      <td>1.01</td>\n",
       "      <td>9.9900</td>\n",
       "      <td>161723.79</td>\n",
       "      <td>177758.596</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>249 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       ts_code  trade_date   open   high    low  close  pre_close  change  \\\n",
       "0    002747.SZ    20200724  16.80  16.81  15.56  16.20      16.51   -0.31   \n",
       "1    002747.SZ    20200723  17.80  18.07  16.24  16.51      17.95   -1.44   \n",
       "2    002747.SZ    20200722  17.12  18.18  16.90  17.95      17.21    0.74   \n",
       "3    002747.SZ    20200721  17.20  17.87  16.77  17.21      16.97    0.24   \n",
       "4    002747.SZ    20200720  15.80  16.97  15.50  16.97      15.43    1.54   \n",
       "5    002747.SZ    20200717  14.86  15.80  14.80  15.43      14.87    0.56   \n",
       "6    002747.SZ    20200716  14.95  16.10  14.83  14.87      15.23   -0.36   \n",
       "7    002747.SZ    20200715  15.40  15.60  14.80  15.23      15.20    0.03   \n",
       "8    002747.SZ    20200714  15.21  16.16  14.68  15.20      15.32   -0.12   \n",
       "9    002747.SZ    20200713  14.97  15.43  14.75  15.32      15.12    0.20   \n",
       "10   002747.SZ    20200710  15.63  15.68  14.60  15.12      15.50   -0.38   \n",
       "11   002747.SZ    20200709  14.20  15.50  14.01  15.50      14.09    1.41   \n",
       "12   002747.SZ    20200708  13.03  14.40  13.03  14.09      13.09    1.00   \n",
       "13   002747.SZ    20200707  13.05  13.55  12.92  13.09      13.00    0.09   \n",
       "14   002747.SZ    20200706  12.97  13.16  12.78  13.00      12.90    0.10   \n",
       "15   002747.SZ    20200703  12.39  13.10  12.30  12.90      12.35    0.55   \n",
       "16   002747.SZ    20200702  12.37  12.48  12.05  12.35      12.38   -0.03   \n",
       "17   002747.SZ    20200701  11.95  12.65  11.80  12.38      11.96    0.42   \n",
       "18   002747.SZ    20200630  11.62  12.15  11.51  11.96      11.58    0.38   \n",
       "19   002747.SZ    20200629  11.17  11.77  10.96  11.58      11.19    0.39   \n",
       "20   002747.SZ    20200624  11.32  11.41  11.08  11.19      11.35   -0.16   \n",
       "21   002747.SZ    20200623  11.09  11.72  11.03  11.35      11.08    0.27   \n",
       "22   002747.SZ    20200622  11.10  11.31  10.93  11.08      11.05    0.03   \n",
       "23   002747.SZ    20200619  11.15  11.20  10.93  11.05      11.05    0.00   \n",
       "24   002747.SZ    20200618  11.22  11.39  11.00  11.05      11.33   -0.28   \n",
       "25   002747.SZ    20200617  11.40  11.69  11.10  11.33      10.96    0.37   \n",
       "26   002747.SZ    20200616  10.09  10.96  10.05  10.96       9.96    1.00   \n",
       "27   002747.SZ    20200615  10.24  10.37   9.95   9.96      10.24   -0.28   \n",
       "31   002747.SZ    20200609  10.88  10.95  10.60  10.74      10.90   -0.16   \n",
       "32   002747.SZ    20200608  11.03  11.23  10.84  10.90      10.98   -0.08   \n",
       "..         ...         ...    ...    ...    ...    ...        ...     ...   \n",
       "681  002747.SZ    20170918  14.76  15.26  14.53  14.68      14.97   -0.29   \n",
       "682  002747.SZ    20170915  14.58  15.14  14.36  14.97      14.81    0.16   \n",
       "683  002747.SZ    20170914  15.13  15.80  14.80  14.81      14.95   -0.14   \n",
       "684  002747.SZ    20170913  14.49  15.06  14.00  14.95      14.70    0.25   \n",
       "685  002747.SZ    20170912  14.75  15.56  14.58  14.70      14.82   -0.12   \n",
       "686  002747.SZ    20170911  13.50  14.82  13.37  14.82      13.47    1.35   \n",
       "687  002747.SZ    20170908  13.78  13.79  13.24  13.47      13.87   -0.40   \n",
       "688  002747.SZ    20170907  14.30  14.32  13.81  13.87      14.44   -0.57   \n",
       "689  002747.SZ    20170906  13.96  14.74  13.88  14.44      14.24    0.20   \n",
       "690  002747.SZ    20170905  13.48  14.57  13.22  14.24      13.53    0.71   \n",
       "691  002747.SZ    20170904  12.22  13.53  12.22  13.53      12.30    1.23   \n",
       "695  002747.SZ    20170829  12.54  12.54  12.30  12.45      12.69   -0.24   \n",
       "696  002747.SZ    20170828  12.52  12.89  12.52  12.69      12.47    0.22   \n",
       "698  002747.SZ    20170824  12.83  12.86  12.20  12.48      12.84   -0.36   \n",
       "699  002747.SZ    20170823  12.45  13.43  12.45  12.84      12.26    0.58   \n",
       "700  002747.SZ    20170822  12.80  12.85  12.20  12.26      12.74   -0.48   \n",
       "702  002747.SZ    20170818  12.76  12.89  12.60  12.66      12.92   -0.26   \n",
       "703  002747.SZ    20170817  12.28  13.56  12.18  12.92      12.38    0.54   \n",
       "704  002747.SZ    20170816  12.38  12.54  12.10  12.38      12.29    0.09   \n",
       "705  002747.SZ    20170815  12.44  12.67  12.16  12.29      12.47   -0.18   \n",
       "706  002747.SZ    20170814  12.10  12.58  12.10  12.47      12.11    0.36   \n",
       "707  002747.SZ    20170811  12.20  12.68  12.08  12.11      12.40   -0.29   \n",
       "708  002747.SZ    20170810  12.12  12.40  11.50  12.40      12.24    0.16   \n",
       "709  002747.SZ    20170809  11.91  12.50  11.91  12.24      11.86    0.38   \n",
       "713  002747.SZ    20170803  11.59  11.97  11.45  11.90      11.78    0.12   \n",
       "714  002747.SZ    20170802  11.17  12.30  11.17  11.78      11.19    0.59   \n",
       "718  002747.SZ    20170727  11.26  11.58  11.01  11.41      11.19    0.22   \n",
       "720  002747.SZ    20170725  11.34  11.42  11.06  11.29      11.52   -0.23   \n",
       "721  002747.SZ    20170724  11.19  11.88  11.11  11.52      11.12    0.40   \n",
       "722  002747.SZ    20170721  10.30  11.12  10.28  11.12      10.11    1.01   \n",
       "\n",
       "     pct_chg        vol      amount  \n",
       "0    -1.8776  285487.23  460908.718  \n",
       "1    -8.0223  332693.07  561431.842  \n",
       "2     4.2998  184201.74  325956.565  \n",
       "3     1.4143  226621.76  390465.486  \n",
       "4     9.9806  320102.62  530137.992  \n",
       "5     3.7660  199292.16  305435.914  \n",
       "6    -2.3638  229290.80  353556.481  \n",
       "7     0.1974  213356.58  323258.908  \n",
       "8    -0.7833  222269.86  340759.697  \n",
       "9     1.3228  184452.45  278886.698  \n",
       "10   -2.4516  218210.43  329484.318  \n",
       "11   10.0071  267772.91  395199.486  \n",
       "12    7.6394  293345.03  407198.381  \n",
       "13    0.6923  184150.75  243893.075  \n",
       "14    0.7752  241303.32  313084.240  \n",
       "15    4.4534  218369.18  278710.530  \n",
       "16   -0.2423  164501.68  201440.634  \n",
       "17    3.5117  228877.17  280866.551  \n",
       "18    3.2815  192286.30  228599.446  \n",
       "19    3.4853  207979.77  237171.977  \n",
       "20   -1.4097  124793.19  140215.789  \n",
       "21    2.4368  223595.75  256107.121  \n",
       "22    0.2715  145578.40  161746.863  \n",
       "23    0.0000  113959.89  125997.534  \n",
       "24   -2.4713  150478.58  168049.284  \n",
       "25    3.3759  278214.10  313691.260  \n",
       "26   10.0402  177673.09  188478.610  \n",
       "27   -2.7344  131237.86  133263.669  \n",
       "31   -1.4679  107257.02  115350.037  \n",
       "32   -0.7286  118986.02  130820.131  \n",
       "..       ...        ...         ...  \n",
       "681  -1.9400  153897.99  228707.483  \n",
       "682   1.0800  201289.19  297906.732  \n",
       "683  -0.9400  353446.43  539255.175  \n",
       "684   1.7000  328431.65  476672.593  \n",
       "685  -0.8100  543655.08  814316.938  \n",
       "686  10.0200  490574.54  708201.434  \n",
       "687  -2.8800  251060.04  337836.218  \n",
       "688  -3.9500  245508.61  344740.766  \n",
       "689   1.4000  341862.55  491219.726  \n",
       "690   5.2500  409734.21  574570.382  \n",
       "691  10.0000  312931.88  409827.692  \n",
       "695  -1.8900   94616.85  117154.873  \n",
       "696   1.7600  107939.73  137234.693  \n",
       "698  -2.8000  111538.10  138581.242  \n",
       "699   4.7300  188946.84  243652.628  \n",
       "700  -3.7700  106203.76  132018.325  \n",
       "702  -2.0100  103992.25  132189.295  \n",
       "703   4.3600  241490.81  309030.232  \n",
       "704   0.7300   92100.24  113470.570  \n",
       "705  -1.4400   96385.67  118870.079  \n",
       "706   2.9700  115510.84  143132.278  \n",
       "707  -2.3400  128648.45  158873.570  \n",
       "708   1.3100  146709.17  176845.683  \n",
       "709   3.2000  219338.05  269819.114  \n",
       "713   1.0200  142621.06  167400.909  \n",
       "714   5.2700  199954.40  236128.395  \n",
       "718   1.9700  114912.20  130409.432  \n",
       "720  -2.0000  110796.27  124175.062  \n",
       "721   3.6000  225583.50  259010.552  \n",
       "722   9.9900  161723.79  177758.596  \n",
       "\n",
       "[249 rows x 11 columns]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[df['vol'] > df['vol'].mean(),:]\n",
    "# iloc[3,5], ix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>trade_date</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200720</td>\n",
       "      <td>115.80</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.50</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>1.54</td>\n",
       "      <td>9.9806</td>\n",
       "      <td>320102.62</td>\n",
       "      <td>530137.992</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200709</td>\n",
       "      <td>114.20</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.01</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.09</td>\n",
       "      <td>1.41</td>\n",
       "      <td>10.0071</td>\n",
       "      <td>267772.91</td>\n",
       "      <td>395199.486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200616</td>\n",
       "      <td>110.09</td>\n",
       "      <td>10.96</td>\n",
       "      <td>10.05</td>\n",
       "      <td>10.96</td>\n",
       "      <td>9.96</td>\n",
       "      <td>1.00</td>\n",
       "      <td>10.0402</td>\n",
       "      <td>177673.09</td>\n",
       "      <td>188478.610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>115</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200206</td>\n",
       "      <td>110.70</td>\n",
       "      <td>11.78</td>\n",
       "      <td>10.50</td>\n",
       "      <td>11.78</td>\n",
       "      <td>10.71</td>\n",
       "      <td>1.07</td>\n",
       "      <td>9.9907</td>\n",
       "      <td>256243.34</td>\n",
       "      <td>289982.744</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>129</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200109</td>\n",
       "      <td>111.24</td>\n",
       "      <td>12.20</td>\n",
       "      <td>11.23</td>\n",
       "      <td>12.20</td>\n",
       "      <td>11.09</td>\n",
       "      <td>1.11</td>\n",
       "      <td>10.0090</td>\n",
       "      <td>204716.67</td>\n",
       "      <td>243318.704</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>210</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20190909</td>\n",
       "      <td>110.08</td>\n",
       "      <td>10.08</td>\n",
       "      <td>10.08</td>\n",
       "      <td>10.08</td>\n",
       "      <td>9.16</td>\n",
       "      <td>0.92</td>\n",
       "      <td>10.0437</td>\n",
       "      <td>7829.00</td>\n",
       "      <td>7891.632</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>329</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20190305</td>\n",
       "      <td>110.45</td>\n",
       "      <td>11.33</td>\n",
       "      <td>10.35</td>\n",
       "      <td>11.33</td>\n",
       "      <td>10.30</td>\n",
       "      <td>1.03</td>\n",
       "      <td>10.0000</td>\n",
       "      <td>201177.91</td>\n",
       "      <td>218377.167</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>542</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20180418</td>\n",
       "      <td>111.84</td>\n",
       "      <td>12.87</td>\n",
       "      <td>11.70</td>\n",
       "      <td>12.87</td>\n",
       "      <td>11.70</td>\n",
       "      <td>1.17</td>\n",
       "      <td>10.0000</td>\n",
       "      <td>258711.20</td>\n",
       "      <td>325185.223</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>686</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170911</td>\n",
       "      <td>113.50</td>\n",
       "      <td>14.82</td>\n",
       "      <td>13.37</td>\n",
       "      <td>14.82</td>\n",
       "      <td>13.47</td>\n",
       "      <td>1.35</td>\n",
       "      <td>10.0200</td>\n",
       "      <td>490574.54</td>\n",
       "      <td>708201.434</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>691</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170904</td>\n",
       "      <td>112.22</td>\n",
       "      <td>13.53</td>\n",
       "      <td>12.22</td>\n",
       "      <td>13.53</td>\n",
       "      <td>12.30</td>\n",
       "      <td>1.23</td>\n",
       "      <td>10.0000</td>\n",
       "      <td>312931.88</td>\n",
       "      <td>409827.692</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>722</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20170721</td>\n",
       "      <td>110.30</td>\n",
       "      <td>11.12</td>\n",
       "      <td>10.28</td>\n",
       "      <td>11.12</td>\n",
       "      <td>10.11</td>\n",
       "      <td>1.01</td>\n",
       "      <td>9.9900</td>\n",
       "      <td>161723.79</td>\n",
       "      <td>177758.596</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       ts_code  trade_date    open   high    low  close  pre_close  change  \\\n",
       "4    002747.SZ    20200720  115.80  16.97  15.50  16.97      15.43    1.54   \n",
       "11   002747.SZ    20200709  114.20  15.50  14.01  15.50      14.09    1.41   \n",
       "26   002747.SZ    20200616  110.09  10.96  10.05  10.96       9.96    1.00   \n",
       "115  002747.SZ    20200206  110.70  11.78  10.50  11.78      10.71    1.07   \n",
       "129  002747.SZ    20200109  111.24  12.20  11.23  12.20      11.09    1.11   \n",
       "210  002747.SZ    20190909  110.08  10.08  10.08  10.08       9.16    0.92   \n",
       "329  002747.SZ    20190305  110.45  11.33  10.35  11.33      10.30    1.03   \n",
       "542  002747.SZ    20180418  111.84  12.87  11.70  12.87      11.70    1.17   \n",
       "686  002747.SZ    20170911  113.50  14.82  13.37  14.82      13.47    1.35   \n",
       "691  002747.SZ    20170904  112.22  13.53  12.22  13.53      12.30    1.23   \n",
       "722  002747.SZ    20170721  110.30  11.12  10.28  11.12      10.11    1.01   \n",
       "\n",
       "     pct_chg        vol      amount  \n",
       "4     9.9806  320102.62  530137.992  \n",
       "11   10.0071  267772.91  395199.486  \n",
       "26   10.0402  177673.09  188478.610  \n",
       "115   9.9907  256243.34  289982.744  \n",
       "129  10.0090  204716.67  243318.704  \n",
       "210  10.0437    7829.00    7891.632  \n",
       "329  10.0000  201177.91  218377.167  \n",
       "542  10.0000  258711.20  325185.223  \n",
       "686  10.0200  490574.54  708201.434  \n",
       "691  10.0000  312931.88  409827.692  \n",
       "722   9.9900  161723.79  177758.596  "
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[df['pct_chg'] > 9.9,:] # 输出所有涨停的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>trade_date</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200722</td>\n",
       "      <td>117.12</td>\n",
       "      <td>18.18</td>\n",
       "      <td>16.90</td>\n",
       "      <td>17.95</td>\n",
       "      <td>17.21</td>\n",
       "      <td>0.74</td>\n",
       "      <td>4.2998</td>\n",
       "      <td>184201.74</td>\n",
       "      <td>325956.565</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200721</td>\n",
       "      <td>117.20</td>\n",
       "      <td>17.87</td>\n",
       "      <td>16.77</td>\n",
       "      <td>17.21</td>\n",
       "      <td>16.97</td>\n",
       "      <td>0.24</td>\n",
       "      <td>1.4143</td>\n",
       "      <td>226621.76</td>\n",
       "      <td>390465.486</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200720</td>\n",
       "      <td>115.80</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.50</td>\n",
       "      <td>16.97</td>\n",
       "      <td>15.43</td>\n",
       "      <td>1.54</td>\n",
       "      <td>9.9806</td>\n",
       "      <td>320102.62</td>\n",
       "      <td>530137.992</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200723</td>\n",
       "      <td>117.80</td>\n",
       "      <td>18.07</td>\n",
       "      <td>16.24</td>\n",
       "      <td>16.51</td>\n",
       "      <td>17.95</td>\n",
       "      <td>-1.44</td>\n",
       "      <td>-8.0223</td>\n",
       "      <td>332693.07</td>\n",
       "      <td>561431.842</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>476</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20180724</td>\n",
       "      <td>115.18</td>\n",
       "      <td>16.42</td>\n",
       "      <td>15.18</td>\n",
       "      <td>16.35</td>\n",
       "      <td>15.25</td>\n",
       "      <td>1.10</td>\n",
       "      <td>7.2131</td>\n",
       "      <td>189263.20</td>\n",
       "      <td>301483.183</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200724</td>\n",
       "      <td>116.80</td>\n",
       "      <td>16.81</td>\n",
       "      <td>15.56</td>\n",
       "      <td>16.20</td>\n",
       "      <td>16.51</td>\n",
       "      <td>-0.31</td>\n",
       "      <td>-1.8776</td>\n",
       "      <td>285487.23</td>\n",
       "      <td>460908.718</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>475</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20180725</td>\n",
       "      <td>116.16</td>\n",
       "      <td>16.26</td>\n",
       "      <td>15.81</td>\n",
       "      <td>15.90</td>\n",
       "      <td>16.35</td>\n",
       "      <td>-0.45</td>\n",
       "      <td>-2.7523</td>\n",
       "      <td>110424.70</td>\n",
       "      <td>176590.221</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>480</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20180718</td>\n",
       "      <td>115.60</td>\n",
       "      <td>16.15</td>\n",
       "      <td>15.37</td>\n",
       "      <td>15.69</td>\n",
       "      <td>15.52</td>\n",
       "      <td>0.17</td>\n",
       "      <td>1.1000</td>\n",
       "      <td>167440.56</td>\n",
       "      <td>263707.018</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>481</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20180717</td>\n",
       "      <td>114.60</td>\n",
       "      <td>15.75</td>\n",
       "      <td>14.60</td>\n",
       "      <td>15.52</td>\n",
       "      <td>14.70</td>\n",
       "      <td>0.82</td>\n",
       "      <td>5.5800</td>\n",
       "      <td>200447.43</td>\n",
       "      <td>307922.803</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200709</td>\n",
       "      <td>114.20</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.01</td>\n",
       "      <td>15.50</td>\n",
       "      <td>14.09</td>\n",
       "      <td>1.41</td>\n",
       "      <td>10.0071</td>\n",
       "      <td>267772.91</td>\n",
       "      <td>395199.486</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       ts_code  trade_date    open   high    low  close  pre_close  change  \\\n",
       "2    002747.SZ    20200722  117.12  18.18  16.90  17.95      17.21    0.74   \n",
       "3    002747.SZ    20200721  117.20  17.87  16.77  17.21      16.97    0.24   \n",
       "4    002747.SZ    20200720  115.80  16.97  15.50  16.97      15.43    1.54   \n",
       "1    002747.SZ    20200723  117.80  18.07  16.24  16.51      17.95   -1.44   \n",
       "476  002747.SZ    20180724  115.18  16.42  15.18  16.35      15.25    1.10   \n",
       "0    002747.SZ    20200724  116.80  16.81  15.56  16.20      16.51   -0.31   \n",
       "475  002747.SZ    20180725  116.16  16.26  15.81  15.90      16.35   -0.45   \n",
       "480  002747.SZ    20180718  115.60  16.15  15.37  15.69      15.52    0.17   \n",
       "481  002747.SZ    20180717  114.60  15.75  14.60  15.52      14.70    0.82   \n",
       "11   002747.SZ    20200709  114.20  15.50  14.01  15.50      14.09    1.41   \n",
       "\n",
       "     pct_chg        vol      amount  \n",
       "2     4.2998  184201.74  325956.565  \n",
       "3     1.4143  226621.76  390465.486  \n",
       "4     9.9806  320102.62  530137.992  \n",
       "1    -8.0223  332693.07  561431.842  \n",
       "476   7.2131  189263.20  301483.183  \n",
       "0    -1.8776  285487.23  460908.718  \n",
       "475  -2.7523  110424.70  176590.221  \n",
       "480   1.1000  167440.56  263707.018  \n",
       "481   5.5800  200447.43  307922.803  \n",
       "11   10.0071  267772.91  395199.486  "
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sort_df = df.sort_values('close', ascending = False)\n",
    "sort_df.head(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### Apply 函数\n",
    "\n",
    "1. 因为apply函数极其灵活高效，甚至是重新定义了pandas的灵活；\n",
    "2. apply概念相对晦涩，需要结合具体案例去咀嚼和实践。\n",
    "\n",
    "该函数经常和df.groupby一起使用"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('002350.SZ',\n",
       "       trade_date    ts_code  open  high   low  close  pre_close  change  \\\n",
       "  552    20200729  002350.SZ  5.36  5.46  5.28   5.45       5.37    0.08   \n",
       "  553    20200728  002350.SZ  5.35  5.42  5.31   5.37       5.35    0.02   \n",
       "  554    20200727  002350.SZ  5.32  5.42  5.26   5.35       5.31    0.04   \n",
       "  555    20200724  002350.SZ  5.47  5.54  5.31   5.31       5.49   -0.18   \n",
       "  556    20200723  002350.SZ  5.48  5.49  5.32   5.49       5.51   -0.02   \n",
       "  557    20200722  002350.SZ  5.48  5.54  5.44   5.51       5.50    0.01   \n",
       "  558    20200721  002350.SZ  5.46  5.55  5.43   5.50       5.43    0.07   \n",
       "  559    20200720  002350.SZ  5.31  5.47  5.30   5.43       5.27    0.16   \n",
       "  560    20200717  002350.SZ  5.38  5.41  5.23   5.27       5.37   -0.10   \n",
       "  561    20200716  002350.SZ  5.57  5.62  5.33   5.37       5.59   -0.22   \n",
       "  562    20200715  002350.SZ  5.74  5.75  5.51   5.59       5.71   -0.12   \n",
       "  563    20200714  002350.SZ  5.72  5.80  5.58   5.71       5.73   -0.02   \n",
       "  564    20200713  002350.SZ  5.57  5.73  5.55   5.73       5.56    0.17   \n",
       "  565    20200710  002350.SZ  5.74  5.74  5.56   5.56       5.74   -0.18   \n",
       "  566    20200709  002350.SZ  5.68  5.77  5.61   5.74       5.66    0.08   \n",
       "  567    20200708  002350.SZ  5.55  5.66  5.53   5.66       5.60    0.06   \n",
       "  568    20200707  002350.SZ  5.58  5.67  5.48   5.60       5.57    0.03   \n",
       "  569    20200706  002350.SZ  5.42  5.60  5.25   5.57       5.48    0.09   \n",
       "  570    20200703  002350.SZ  5.89  5.89  5.46   5.48       5.35    0.13   \n",
       "  571    20200701  002350.SZ  5.24  5.36  5.17   5.35       5.24    0.11   \n",
       "  572    20200630  002350.SZ  5.28  5.30  5.20   5.24       5.27   -0.03   \n",
       "  573    20200629  002350.SZ  5.21  5.32  5.13   5.27       5.27    0.00   \n",
       "  574    20200624  002350.SZ  5.22  5.34  5.22   5.27       5.26    0.01   \n",
       "  575    20200623  002350.SZ  5.22  5.36  5.22   5.26       5.28   -0.02   \n",
       "  576    20200622  002350.SZ  5.17  5.33  5.14   5.28       5.19    0.09   \n",
       "  577    20200619  002350.SZ  5.26  5.33  5.16   5.19       5.35   -0.16   \n",
       "  578    20200618  002350.SZ  5.62  5.80  5.33   5.35       5.63   -0.28   \n",
       "  579    20200617  002350.SZ  5.63  5.63  5.58   5.63       5.12    0.51   \n",
       "  580    20200616  002350.SZ  5.07  5.14  5.07   5.12       5.08    0.04   \n",
       "  581    20200615  002350.SZ  4.98  5.10  4.98   5.08       5.02    0.06   \n",
       "  ..          ...        ...   ...   ...   ...    ...        ...     ...   \n",
       "  659    20200220  002350.SZ  6.07  6.23  5.94   6.20       6.08    0.12   \n",
       "  660    20200219  002350.SZ  6.23  6.26  6.04   6.08       6.28   -0.20   \n",
       "  661    20200218  002350.SZ  6.10  6.39  6.06   6.28       6.16    0.12   \n",
       "  662    20200217  002350.SZ  6.00  6.17  5.95   6.16       6.06    0.10   \n",
       "  663    20200214  002350.SZ  5.79  6.19  5.71   6.06       5.99    0.07   \n",
       "  664    20200213  002350.SZ  6.20  6.44  5.99   5.99       5.92    0.07   \n",
       "  665    20200212  002350.SZ  5.46  5.92  5.45   5.92       5.38    0.54   \n",
       "  666    20200211  002350.SZ  5.47  5.49  5.37   5.38       5.47   -0.09   \n",
       "  667    20200210  002350.SZ  5.32  5.47  5.27   5.47       5.32    0.15   \n",
       "  668    20200207  002350.SZ  5.19  5.34  5.13   5.32       5.19    0.13   \n",
       "  669    20200206  002350.SZ  5.11  5.22  5.10   5.19       5.14    0.05   \n",
       "  670    20200205  002350.SZ  5.09  5.23  5.09   5.14       5.08    0.06   \n",
       "  671    20200204  002350.SZ  4.72  5.23  4.72   5.08       5.24   -0.16   \n",
       "  672    20200203  002350.SZ  5.24  5.24  5.24   5.24       5.82   -0.58   \n",
       "  673    20200123  002350.SZ  5.98  6.02  5.74   5.82       5.99   -0.17   \n",
       "  674    20200122  002350.SZ  5.92  6.07  5.83   5.99       6.00   -0.01   \n",
       "  675    20200121  002350.SZ  6.16  6.17  5.96   6.00       6.15   -0.15   \n",
       "  676    20200120  002350.SZ  6.08  6.16  6.05   6.15       6.10    0.05   \n",
       "  677    20200117  002350.SZ  6.14  6.22  6.10   6.10       6.19   -0.09   \n",
       "  678    20200116  002350.SZ  6.34  6.34  6.19   6.19       6.36   -0.17   \n",
       "  679    20200115  002350.SZ  6.55  6.60  6.25   6.36       6.59   -0.23   \n",
       "  680    20200114  002350.SZ  6.48  6.92  6.45   6.59       6.54    0.05   \n",
       "  681    20200113  002350.SZ  6.50  6.62  6.41   6.54       6.71   -0.17   \n",
       "  682    20200110  002350.SZ  6.05  6.71  5.97   6.71       6.10    0.61   \n",
       "  683    20200109  002350.SZ  6.28  6.37  5.92   6.10       6.05    0.05   \n",
       "  684    20200108  002350.SZ  6.20  6.52  6.01   6.05       5.93    0.12   \n",
       "  685    20200107  002350.SZ  5.75  6.07  5.75   5.93       5.72    0.21   \n",
       "  686    20200106  002350.SZ  5.65  5.74  5.65   5.72       5.69    0.03   \n",
       "  687    20200103  002350.SZ  5.66  5.74  5.65   5.69       5.67    0.02   \n",
       "  688    20200102  002350.SZ  5.65  5.68  5.60   5.67       5.60    0.07   \n",
       "  \n",
       "       pct_chg        vol      amount  \n",
       "  552   1.4898   42830.66   23080.964  \n",
       "  553   0.3738   37933.56   20376.337  \n",
       "  554   0.7533   35949.53   19174.805  \n",
       "  555  -3.2787   57973.46   31432.824  \n",
       "  556  -0.3630   57060.82   30938.142  \n",
       "  557   0.1818   49145.66   27078.577  \n",
       "  558   1.2891   56019.20   30674.133  \n",
       "  559   3.0361   48033.63   25856.039  \n",
       "  560  -1.8622   53646.54   28390.846  \n",
       "  561  -3.9356   73054.31   40000.315  \n",
       "  562  -2.1016   79173.03   44460.553  \n",
       "  563  -0.3490  111831.00   63394.296  \n",
       "  564   3.0576  123024.10   69763.373  \n",
       "  565  -3.1359  135707.84   76450.257  \n",
       "  566   1.4134  148688.68   84883.122  \n",
       "  567   1.0714  149852.01   84182.065  \n",
       "  568   0.5386  186507.00  104337.444  \n",
       "  569   1.6423  249966.20  135939.226  \n",
       "  570   2.4299  252241.22  142854.970  \n",
       "  571   2.0992   88327.32   46388.495  \n",
       "  572  -0.5693   67916.14   35641.093  \n",
       "  573   0.0000   69510.76   36361.599  \n",
       "  574   0.1901   62936.11   33255.551  \n",
       "  575  -0.3788   83361.45   44122.085  \n",
       "  576   1.7341  107360.26   56026.992  \n",
       "  577  -2.9907  148467.35   77403.732  \n",
       "  578  -4.9734  268187.45  148390.675  \n",
       "  579   9.9609  114740.08   64590.758  \n",
       "  580   0.7874   31606.97   16144.006  \n",
       "  581   1.1952   34298.04   17390.988  \n",
       "  ..       ...        ...         ...  \n",
       "  659   1.9737  136050.11   83301.161  \n",
       "  660  -3.1847  126933.50   78189.836  \n",
       "  661   1.9481  174172.50  108591.280  \n",
       "  662   1.6502  126684.60   76711.019  \n",
       "  663   1.1686  160717.53   95509.993  \n",
       "  664   1.1824  280371.90  173459.234  \n",
       "  665  10.0372  155563.45   89984.065  \n",
       "  666  -1.6453   39459.27   21350.565  \n",
       "  667   2.8195   46564.08   25228.387  \n",
       "  668   2.5048   53671.38   28235.062  \n",
       "  669   0.9728   50352.95   26031.271  \n",
       "  670   1.1811   47655.51   24578.871  \n",
       "  671  -3.0534   77073.61   38838.267  \n",
       "  672  -9.9656   11901.00    6236.124  \n",
       "  673  -2.8381   48644.92   28534.580  \n",
       "  674  -0.1667   48130.38   28812.409  \n",
       "  675  -2.4390   57842.42   34871.239  \n",
       "  676   0.8197   49417.89   30162.397  \n",
       "  677  -1.4540   59659.40   36665.953  \n",
       "  678  -2.6730   78552.90   48990.967  \n",
       "  679  -3.4901  148040.02   93985.570  \n",
       "  680   0.7645  211606.87  141252.242  \n",
       "  681  -2.5335  260810.94  169894.614  \n",
       "  682  10.0000  332168.68  215221.161  \n",
       "  683   0.8264  140280.25   85630.713  \n",
       "  684   2.0236  182015.88  111934.573  \n",
       "  685   3.6713  101464.57   59886.982  \n",
       "  686   0.5272   28396.10   16216.815  \n",
       "  687   0.3527   23224.10   13208.640  \n",
       "  688   1.2500   30157.31   17036.562  \n",
       "  \n",
       "  [137 rows x 11 columns]),\n",
       " ('002660.SZ',\n",
       "       trade_date    ts_code   open   high   low  close  pre_close  change  \\\n",
       "  414    20200729  002660.SZ   8.73   8.93  8.61   8.92       8.72    0.20   \n",
       "  415    20200728  002660.SZ   8.73   8.76  8.61   8.72       8.64    0.08   \n",
       "  416    20200727  002660.SZ   8.80   8.85  8.51   8.64       8.80   -0.16   \n",
       "  417    20200724  002660.SZ   9.13   9.19  8.72   8.80       9.14   -0.34   \n",
       "  418    20200723  002660.SZ   9.30   9.33  8.90   9.14       9.39   -0.25   \n",
       "  419    20200722  002660.SZ   9.45   9.45  9.24   9.39       9.55   -0.16   \n",
       "  420    20200721  002660.SZ   9.64   9.68  9.43   9.55       9.67   -0.12   \n",
       "  421    20200720  002660.SZ   9.42   9.72  9.42   9.67       9.42    0.25   \n",
       "  422    20200717  002660.SZ   9.22   9.42  9.17   9.42       9.23    0.19   \n",
       "  423    20200716  002660.SZ   9.63   9.70  9.12   9.23       9.59   -0.36   \n",
       "  424    20200715  002660.SZ   9.92   9.93  9.55   9.59       9.95   -0.36   \n",
       "  425    20200714  002660.SZ  10.01  10.01  9.63   9.95       9.98   -0.03   \n",
       "  426    20200713  002660.SZ   9.34  10.15  9.34   9.98       9.30    0.68   \n",
       "  427    20200710  002660.SZ   9.48   9.60  9.27   9.30       9.56   -0.26   \n",
       "  428    20200709  002660.SZ   9.29   9.56  9.27   9.56       9.34    0.22   \n",
       "  429    20200708  002660.SZ   9.20   9.37  9.12   9.34       9.22    0.12   \n",
       "  430    20200707  002660.SZ   9.19   9.43  9.06   9.22       9.22    0.00   \n",
       "  431    20200706  002660.SZ   9.06   9.36  9.03   9.22       9.03    0.19   \n",
       "  432    20200703  002660.SZ   8.91   9.05  8.81   9.03       8.92    0.11   \n",
       "  433    20200702  002660.SZ   8.96   8.99  8.78   8.92       8.90    0.02   \n",
       "  434    20200701  002660.SZ   8.75   8.95  8.66   8.90       8.68    0.22   \n",
       "  435    20200630  002660.SZ   8.54   8.69  8.50   8.68       8.47    0.21   \n",
       "  436    20200629  002660.SZ   8.71   8.74  8.44   8.47       8.74   -0.27   \n",
       "  437    20200624  002660.SZ   8.81   8.84  8.73   8.74       8.83   -0.09   \n",
       "  438    20200623  002660.SZ   8.88   8.88  8.74   8.83       8.89   -0.06   \n",
       "  439    20200622  002660.SZ   8.77   8.91  8.76   8.89       8.83    0.06   \n",
       "  440    20200619  002660.SZ   8.85   8.97  8.76   8.83       8.85   -0.02   \n",
       "  441    20200618  002660.SZ   8.77   8.88  8.71   8.85       8.77    0.08   \n",
       "  442    20200617  002660.SZ   8.65   8.79  8.55   8.77       8.65    0.12   \n",
       "  443    20200616  002660.SZ   8.57   8.67  8.55   8.65       8.52    0.13   \n",
       "  ..          ...        ...    ...    ...   ...    ...        ...     ...   \n",
       "  522    20200220  002660.SZ   8.88   9.08  8.73   9.01       8.79    0.22   \n",
       "  523    20200219  002660.SZ   8.82   9.04  8.75   8.79       8.89   -0.10   \n",
       "  524    20200218  002660.SZ   8.73   8.95  8.60   8.89       8.68    0.21   \n",
       "  525    20200217  002660.SZ   8.38   8.68  8.36   8.68       8.39    0.29   \n",
       "  526    20200214  002660.SZ   8.25   8.43  8.19   8.39       8.33    0.06   \n",
       "  527    20200213  002660.SZ   8.38   8.68  8.30   8.33       8.36   -0.03   \n",
       "  528    20200212  002660.SZ   8.15   8.45  8.10   8.36       8.15    0.21   \n",
       "  529    20200211  002660.SZ   8.18   8.25  8.05   8.15       8.18   -0.03   \n",
       "  530    20200210  002660.SZ   7.90   8.22  7.86   8.18       7.97    0.21   \n",
       "  531    20200207  002660.SZ   7.84   8.03  7.75   7.97       7.88    0.09   \n",
       "  532    20200206  002660.SZ   7.60   7.90  7.59   7.88       7.68    0.20   \n",
       "  533    20200205  002660.SZ   7.40   7.84  7.32   7.68       7.37    0.31   \n",
       "  534    20200204  002660.SZ   7.15   7.57  7.15   7.37       7.94   -0.57   \n",
       "  535    20200203  002660.SZ   7.94   7.94  7.94   7.94       8.82   -0.88   \n",
       "  536    20200123  002660.SZ   9.32   9.42  8.65   8.82       9.38   -0.56   \n",
       "  537    20200122  002660.SZ   9.62   9.62  9.31   9.38       9.47   -0.09   \n",
       "  538    20200121  002660.SZ   9.48   9.86  9.30   9.47       9.44    0.03   \n",
       "  539    20200120  002660.SZ   9.57   9.57  9.17   9.44       9.58   -0.14   \n",
       "  540    20200117  002660.SZ   9.52   9.75  9.52   9.58       9.54    0.04   \n",
       "  541    20200116  002660.SZ   9.70   9.75  9.49   9.54       9.65   -0.11   \n",
       "  542    20200115  002660.SZ   9.58   9.77  9.53   9.65       9.58    0.07   \n",
       "  543    20200114  002660.SZ   9.44   9.60  9.43   9.58       9.49    0.09   \n",
       "  544    20200113  002660.SZ   9.45   9.60  9.42   9.49       9.45    0.04   \n",
       "  545    20200110  002660.SZ   9.58   9.68  9.37   9.45       9.63   -0.18   \n",
       "  546    20200109  002660.SZ   9.54   9.65  9.37   9.63       9.43    0.20   \n",
       "  547    20200108  002660.SZ   9.20   9.74  9.11   9.43       9.25    0.18   \n",
       "  548    20200107  002660.SZ   9.10   9.29  9.10   9.25       9.10    0.15   \n",
       "  549    20200106  002660.SZ   8.82   9.18  8.82   9.10       8.92    0.18   \n",
       "  550    20200103  002660.SZ   8.87   8.93  8.74   8.92       8.91    0.01   \n",
       "  551    20200102  002660.SZ   8.81   8.93  8.81   8.91       8.77    0.14   \n",
       "  \n",
       "       pct_chg        vol      amount  \n",
       "  414   2.2936   63362.62   55703.310  \n",
       "  415   0.9259   42190.76   36687.481  \n",
       "  416  -1.8182   61405.74   53229.802  \n",
       "  417  -3.7199   82550.62   74058.606  \n",
       "  418  -2.6624  104026.37   94870.030  \n",
       "  419  -1.6754  123335.92  115340.074  \n",
       "  420  -1.2410   79499.17   76035.845  \n",
       "  421   2.6539   90421.78   86504.002  \n",
       "  422   2.0585   66025.59   61378.138  \n",
       "  423  -3.7539   99777.50   94482.580  \n",
       "  424  -3.6181  122166.70  118566.497  \n",
       "  425  -0.3006  194026.70  190091.791  \n",
       "  426   7.3118  238799.63  232875.710  \n",
       "  427  -2.7197  145443.12  137327.918  \n",
       "  428   2.3555  176658.69  166216.617  \n",
       "  429   1.3015  134123.30  124478.084  \n",
       "  430   0.0000  201854.15  186605.060  \n",
       "  431   2.1041  195591.69  180195.556  \n",
       "  432   1.2332  116401.74  103899.166  \n",
       "  433   0.2247  118484.52  105088.607  \n",
       "  434   2.5346   99168.74   87832.805  \n",
       "  435   2.4793   46586.21   40176.052  \n",
       "  436  -3.0892   57413.00   49049.545  \n",
       "  437  -1.0193   40843.00   35779.312  \n",
       "  438  -0.6749   61655.01   54298.124  \n",
       "  439   0.6795   63647.01   56208.118  \n",
       "  440  -0.2260   58528.00   51712.504  \n",
       "  441   0.9122   60374.18   53249.271  \n",
       "  442   1.3873   66496.22   57822.402  \n",
       "  443   1.5258   43321.00   37257.771  \n",
       "  ..       ...        ...         ...  \n",
       "  522   2.5028  111483.00   99590.698  \n",
       "  523  -1.1249  113896.47  100963.991  \n",
       "  524   2.4194  120834.96  106109.088  \n",
       "  525   3.4565   75018.00   64377.212  \n",
       "  526   0.7203   80382.42   67075.946  \n",
       "  527  -0.3589   85887.76   72545.698  \n",
       "  528   2.5767   76544.70   63601.667  \n",
       "  529  -0.3667   66437.45   54178.010  \n",
       "  530   2.6349   73263.56   59214.956  \n",
       "  531   1.1421   73541.16   57934.450  \n",
       "  532   2.6042   92846.28   72055.257  \n",
       "  533   4.2062  107798.92   82085.687  \n",
       "  534  -7.1788  154079.17  113527.196  \n",
       "  535  -9.9773    3248.00    2578.912  \n",
       "  536  -5.9701  108702.64   97673.638  \n",
       "  537  -0.9504   85526.44   80521.385  \n",
       "  538   0.3178  115942.21  110831.806  \n",
       "  539  -1.4614   96107.59   89681.241  \n",
       "  540   0.4193   99932.26   96119.640  \n",
       "  541  -1.1399   89791.28   86234.619  \n",
       "  542   0.7307   90479.77   87316.704  \n",
       "  543   0.9484   94698.81   89970.818  \n",
       "  544   0.4233   93067.77   88432.424  \n",
       "  545  -1.8692  111232.23  105464.058  \n",
       "  546   2.1209  170923.38  162963.334  \n",
       "  547   1.9459  209118.43  196190.989  \n",
       "  548   1.6484  119248.88  109812.431  \n",
       "  549   2.0179  141182.18  127321.875  \n",
       "  550   0.1122   92711.84   82148.910  \n",
       "  551   1.5964  107782.16   95686.697  \n",
       "  \n",
       "  [138 rows x 11 columns]),\n",
       " ('002747.SZ',\n",
       "       trade_date    ts_code   open   high    low  close  pre_close  change  \\\n",
       "  138    20200729  002747.SZ  15.58  16.69  15.40  16.53      15.60    0.93   \n",
       "  139    20200728  002747.SZ  15.68  15.98  15.22  15.60      15.38    0.22   \n",
       "  140    20200727  002747.SZ  16.15  16.16  15.15  15.38      16.20   -0.82   \n",
       "  141    20200724  002747.SZ  16.80  16.81  15.56  16.20      16.51   -0.31   \n",
       "  142    20200723  002747.SZ  17.80  18.07  16.24  16.51      17.95   -1.44   \n",
       "  143    20200722  002747.SZ  17.12  18.18  16.90  17.95      17.21    0.74   \n",
       "  144    20200721  002747.SZ  17.20  17.87  16.77  17.21      16.97    0.24   \n",
       "  145    20200720  002747.SZ  15.80  16.97  15.50  16.97      15.43    1.54   \n",
       "  146    20200717  002747.SZ  14.86  15.80  14.80  15.43      14.87    0.56   \n",
       "  147    20200716  002747.SZ  14.95  16.10  14.83  14.87      15.23   -0.36   \n",
       "  148    20200715  002747.SZ  15.40  15.60  14.80  15.23      15.20    0.03   \n",
       "  149    20200714  002747.SZ  15.21  16.16  14.68  15.20      15.32   -0.12   \n",
       "  150    20200713  002747.SZ  14.97  15.43  14.75  15.32      15.12    0.20   \n",
       "  151    20200710  002747.SZ  15.63  15.68  14.60  15.12      15.50   -0.38   \n",
       "  152    20200709  002747.SZ  14.20  15.50  14.01  15.50      14.09    1.41   \n",
       "  153    20200708  002747.SZ  13.03  14.40  13.03  14.09      13.09    1.00   \n",
       "  154    20200707  002747.SZ  13.05  13.55  12.92  13.09      13.00    0.09   \n",
       "  155    20200706  002747.SZ  12.97  13.16  12.78  13.00      12.90    0.10   \n",
       "  156    20200703  002747.SZ  12.39  13.10  12.30  12.90      12.35    0.55   \n",
       "  157    20200702  002747.SZ  12.37  12.48  12.05  12.35      12.38   -0.03   \n",
       "  158    20200701  002747.SZ  11.95  12.65  11.80  12.38      11.96    0.42   \n",
       "  159    20200630  002747.SZ  11.62  12.15  11.51  11.96      11.58    0.38   \n",
       "  160    20200629  002747.SZ  11.17  11.77  10.96  11.58      11.19    0.39   \n",
       "  161    20200624  002747.SZ  11.32  11.41  11.08  11.19      11.35   -0.16   \n",
       "  162    20200623  002747.SZ  11.09  11.72  11.03  11.35      11.08    0.27   \n",
       "  163    20200622  002747.SZ  11.10  11.31  10.93  11.08      11.05    0.03   \n",
       "  164    20200619  002747.SZ  11.15  11.20  10.93  11.05      11.05    0.00   \n",
       "  165    20200618  002747.SZ  11.22  11.39  11.00  11.05      11.33   -0.28   \n",
       "  166    20200617  002747.SZ  11.40  11.69  11.10  11.33      10.96    0.37   \n",
       "  167    20200616  002747.SZ  10.09  10.96  10.05  10.96       9.96    1.00   \n",
       "  ..          ...        ...    ...    ...    ...    ...        ...     ...   \n",
       "  246    20200220  002747.SZ  13.46  13.75  13.19  13.61      13.52    0.09   \n",
       "  247    20200219  002747.SZ  12.82  14.03  12.60  13.52      12.82    0.70   \n",
       "  248    20200218  002747.SZ  12.85  12.92  12.58  12.82      12.81    0.01   \n",
       "  249    20200217  002747.SZ  12.51  12.84  12.38  12.81      12.57    0.24   \n",
       "  250    20200214  002747.SZ  12.41  12.79  12.32  12.57      12.66   -0.09   \n",
       "  251    20200213  002747.SZ  12.29  13.20  12.18  12.66      12.19    0.47   \n",
       "  252    20200212  002747.SZ  11.93  12.32  11.90  12.19      12.03    0.16   \n",
       "  253    20200211  002747.SZ  12.43  12.54  11.94  12.03      12.31   -0.28   \n",
       "  254    20200210  002747.SZ  12.00  12.88  11.88  12.31      11.96    0.35   \n",
       "  255    20200207  002747.SZ  11.95  12.56  11.70  11.96      11.78    0.18   \n",
       "  256    20200206  002747.SZ  10.70  11.78  10.50  11.78      10.71    1.07   \n",
       "  257    20200205  002747.SZ  10.45  10.88  10.30  10.71      10.59    0.12   \n",
       "  258    20200204  002747.SZ   9.64  10.67   9.53  10.59       9.70    0.89   \n",
       "  259    20200203  002747.SZ   9.70   9.84   9.70   9.70      10.78   -1.08   \n",
       "  260    20200123  002747.SZ  11.54  11.59  10.50  10.78      11.62   -0.84   \n",
       "  261    20200122  002747.SZ  11.67  11.84  11.00  11.62      11.88   -0.26   \n",
       "  262    20200121  002747.SZ  11.90  12.16  11.76  11.88      11.88    0.00   \n",
       "  263    20200120  002747.SZ  11.64  12.06  11.60  11.88      11.65    0.23   \n",
       "  264    20200117  002747.SZ  11.83  11.90  11.52  11.65      11.84   -0.19   \n",
       "  265    20200116  002747.SZ  11.73  11.96  11.63  11.84      11.73    0.11   \n",
       "  266    20200115  002747.SZ  11.88  11.88  11.58  11.73      11.93   -0.20   \n",
       "  267    20200114  002747.SZ  12.00  12.15  11.75  11.93      11.94   -0.01   \n",
       "  268    20200113  002747.SZ  11.82  12.09  11.71  11.94      11.94    0.00   \n",
       "  269    20200110  002747.SZ  12.26  12.30  11.74  11.94      12.20   -0.26   \n",
       "  270    20200109  002747.SZ  11.24  12.20  11.23  12.20      11.09    1.11   \n",
       "  271    20200108  002747.SZ  11.25  11.36  11.00  11.09      11.37   -0.28   \n",
       "  272    20200107  002747.SZ  11.07  11.39  10.98  11.37      11.07    0.30   \n",
       "  273    20200106  002747.SZ  11.11  11.23  10.92  11.07      11.27   -0.20   \n",
       "  274    20200103  002747.SZ  11.36  11.48  11.21  11.27      11.29   -0.02   \n",
       "  275    20200102  002747.SZ  11.29  11.48  11.25  11.29      11.26    0.03   \n",
       "  \n",
       "       pct_chg        vol      amount  \n",
       "  138   5.9615  187518.29  300984.436  \n",
       "  139   1.4304  125663.79  195823.200  \n",
       "  140  -5.0617  228584.90  355934.528  \n",
       "  141  -1.8776  285487.23  460908.718  \n",
       "  142  -8.0223  332693.07  561431.842  \n",
       "  143   4.2998  184201.74  325956.565  \n",
       "  144   1.4143  226621.76  390465.486  \n",
       "  145   9.9806  320102.62  530137.992  \n",
       "  146   3.7660  199292.16  305435.914  \n",
       "  147  -2.3638  229290.80  353556.481  \n",
       "  148   0.1974  213356.58  323258.908  \n",
       "  149  -0.7833  222269.86  340759.697  \n",
       "  150   1.3228  184452.45  278886.698  \n",
       "  151  -2.4516  218210.43  329484.318  \n",
       "  152  10.0071  267772.91  395199.486  \n",
       "  153   7.6394  293345.03  407198.381  \n",
       "  154   0.6923  184150.75  243893.075  \n",
       "  155   0.7752  241303.32  313084.240  \n",
       "  156   4.4534  218369.18  278710.530  \n",
       "  157  -0.2423  164501.68  201440.634  \n",
       "  158   3.5117  228877.17  280866.551  \n",
       "  159   3.2815  192286.30  228599.446  \n",
       "  160   3.4853  207979.77  237171.977  \n",
       "  161  -1.4097  124793.19  140215.789  \n",
       "  162   2.4368  223595.75  256107.121  \n",
       "  163   0.2715  145578.40  161746.863  \n",
       "  164   0.0000  113959.89  125997.534  \n",
       "  165  -2.4713  150478.58  168049.284  \n",
       "  166   3.3759  278214.10  313691.260  \n",
       "  167  10.0402  177673.09  188478.610  \n",
       "  ..       ...        ...         ...  \n",
       "  246   0.6657  197563.81  265874.859  \n",
       "  247   5.4602  286537.16  383271.057  \n",
       "  248   0.0781  156361.54  199256.232  \n",
       "  249   1.9093  188023.75  237659.619  \n",
       "  250  -0.7109  144414.66  180683.591  \n",
       "  251   3.8556  264140.73  337206.983  \n",
       "  252   1.3300  180139.71  218717.738  \n",
       "  253  -2.2746  197232.12  240087.746  \n",
       "  254   2.9264  234882.29  290718.238  \n",
       "  255   1.5280  256251.44  308776.651  \n",
       "  256   9.9907  256243.34  289982.744  \n",
       "  257   1.1331  161618.16  171293.788  \n",
       "  258   9.1753  189291.61  191920.736  \n",
       "  259 -10.0186   81077.56   78763.712  \n",
       "  260  -7.2289  213356.49  232059.900  \n",
       "  261  -2.1886  195031.20  222815.256  \n",
       "  262   0.0000   90847.01  108418.376  \n",
       "  263   1.9742   81398.09   96327.891  \n",
       "  264  -1.6047   78974.70   92696.620  \n",
       "  265   0.9378   71072.79   83983.817  \n",
       "  266  -1.6764   81082.20   94838.296  \n",
       "  267  -0.0838   82833.03   98709.606  \n",
       "  268   0.0000  120355.39  143061.058  \n",
       "  269  -2.1311  189932.45  227626.172  \n",
       "  270  10.0090  204716.67  243318.704  \n",
       "  271  -2.4626   96183.16  107562.563  \n",
       "  272   2.7100  154765.09  173100.122  \n",
       "  273  -1.7746  159696.02  176331.575  \n",
       "  274  -0.1771   51916.83   58771.700  \n",
       "  275   0.2664   77374.66   87830.416  \n",
       "  \n",
       "  [138 rows x 11 columns]),\n",
       " ('300685.SZ',\n",
       "       trade_date    ts_code   open   high    low  close  pre_close  change  \\\n",
       "  0      20200729  300685.SZ  76.88  80.50  75.22  79.53      76.20    3.33   \n",
       "  1      20200728  300685.SZ  76.24  79.43  74.99  76.20      75.37    0.83   \n",
       "  2      20200727  300685.SZ  71.84  75.99  71.09  75.37      70.99    4.38   \n",
       "  3      20200724  300685.SZ  76.56  78.44  70.00  70.99      77.63   -6.64   \n",
       "  4      20200723  300685.SZ  76.70  80.80  76.41  77.63      76.90    0.73   \n",
       "  5      20200722  300685.SZ  73.83  77.59  72.92  76.90      73.85    3.05   \n",
       "  6      20200721  300685.SZ  70.61  74.50  69.50  73.85      70.77    3.08   \n",
       "  7      20200720  300685.SZ  71.98  71.99  67.18  70.77      70.80   -0.03   \n",
       "  8      20200717  300685.SZ  69.76  72.13  68.64  70.80      69.37    1.43   \n",
       "  9      20200716  300685.SZ  78.00  78.26  69.36  69.37      77.07   -7.70   \n",
       "  10     20200715  300685.SZ  75.60  78.68  75.49  77.07      75.78    1.29   \n",
       "  11     20200714  300685.SZ  76.73  78.00  73.00  75.78      77.29   -1.51   \n",
       "  12     20200713  300685.SZ  75.98  77.35  74.30  77.29      74.10    3.19   \n",
       "  13     20200710  300685.SZ  73.75  75.86  72.90  74.10      73.60    0.50   \n",
       "  14     20200709  300685.SZ  71.10  73.65  70.00  73.60      71.16    2.44   \n",
       "  15     20200708  300685.SZ  72.27  72.74  70.35  71.16      72.09   -0.93   \n",
       "  16     20200707  300685.SZ  70.00  73.43  68.70  72.09      71.10    0.99   \n",
       "  17     20200706  300685.SZ  71.02  71.79  68.88  71.10      71.78   -0.68   \n",
       "  18     20200703  300685.SZ  72.50  73.10  70.00  71.78      71.79   -0.01   \n",
       "  19     20200702  300685.SZ  75.13  75.97  71.25  71.79      75.00   -3.21   \n",
       "  20     20200701  300685.SZ  77.12  78.26  72.39  75.00      76.96   -1.96   \n",
       "  21     20200630  300685.SZ  76.30  79.95  75.58  76.96      76.52    0.44   \n",
       "  22     20200629  300685.SZ  70.90  77.39  70.33  76.52      71.39    5.13   \n",
       "  23     20200624  300685.SZ  71.10  71.91  69.80  71.39      71.20    0.19   \n",
       "  24     20200623  300685.SZ  68.28  71.80  68.28  71.20      67.00    4.20   \n",
       "  25     20200622  300685.SZ  66.91  68.40  66.01  67.00      66.96    0.04   \n",
       "  26     20200619  300685.SZ  65.37  67.45  64.30  66.96      64.24    2.72   \n",
       "  27     20200618  300685.SZ  66.99  67.66  63.72  64.24      67.41   -3.17   \n",
       "  28     20200617  300685.SZ  67.00  69.19  66.23  67.41      66.58    0.83   \n",
       "  29     20200616  300685.SZ  63.63  67.79  62.28  66.58      63.15    3.43   \n",
       "  ..          ...        ...    ...    ...    ...    ...        ...     ...   \n",
       "  108    20200220  300685.SZ  75.40  77.77  74.34  76.79      74.51    2.28   \n",
       "  109    20200219  300685.SZ  76.20  77.00  74.50  74.51      76.55   -2.04   \n",
       "  110    20200218  300685.SZ  73.97  77.40  73.06  76.55      73.78    2.77   \n",
       "  111    20200217  300685.SZ  70.30  73.79  70.01  73.78      70.51    3.27   \n",
       "  112    20200214  300685.SZ  71.02  71.85  69.91  70.51      71.85   -1.34   \n",
       "  113    20200213  300685.SZ  73.59  73.60  70.67  71.85      73.59   -1.74   \n",
       "  114    20200212  300685.SZ  71.98  73.70  71.21  73.59      71.87    1.72   \n",
       "  115    20200211  300685.SZ  73.21  73.99  71.31  71.87      72.86   -0.99   \n",
       "  116    20200210  300685.SZ  71.40  72.86  69.96  72.86      71.00    1.86   \n",
       "  117    20200207  300685.SZ  70.40  72.24  69.50  71.00      70.97    0.03   \n",
       "  118    20200206  300685.SZ  69.00  72.50  67.52  70.97      68.50    2.47   \n",
       "  119    20200205  300685.SZ  68.85  71.00  67.09  68.50      68.33    0.17   \n",
       "  120    20200204  300685.SZ  68.00  71.48  66.60  68.33      66.25    2.08   \n",
       "  121    20200203  300685.SZ  64.62  70.00  64.62  66.25      71.50   -5.25   \n",
       "  122    20200123  300685.SZ  72.98  73.88  70.30  71.50      73.49   -1.99   \n",
       "  123    20200122  300685.SZ  71.15  74.19  70.72  73.49      72.46    1.03   \n",
       "  124    20200121  300685.SZ  72.40  74.61  71.79  72.46      72.50   -0.04   \n",
       "  125    20200120  300685.SZ  71.50  73.79  71.24  72.50      72.89   -0.39   \n",
       "  126    20200117  300685.SZ  72.13  73.50  71.30  72.89      72.12    0.77   \n",
       "  127    20200116  300685.SZ  69.00  72.67  68.40  72.12      69.00    3.12   \n",
       "  128    20200115  300685.SZ  68.33  69.34  67.29  69.00      68.08    0.92   \n",
       "  129    20200114  300685.SZ  69.00  70.23  67.79  68.08      70.20   -2.12   \n",
       "  130    20200113  300685.SZ  69.49  70.34  68.18  70.20      69.14    1.06   \n",
       "  131    20200110  300685.SZ  69.11  69.47  68.38  69.14      68.95    0.19   \n",
       "  132    20200109  300685.SZ  67.50  69.39  66.89  68.95      66.87    2.08   \n",
       "  133    20200108  300685.SZ  67.53  67.97  66.60  66.87      67.50   -0.63   \n",
       "  134    20200107  300685.SZ  64.83  67.57  64.39  67.50      64.83    2.67   \n",
       "  135    20200106  300685.SZ  66.90  66.90  64.25  64.83      66.97   -2.14   \n",
       "  136    20200103  300685.SZ  66.48  67.50  66.48  66.97      66.77    0.20   \n",
       "  137    20200102  300685.SZ  67.00  67.47  65.78  66.77      66.82   -0.05   \n",
       "  \n",
       "       pct_chg       vol      amount  \n",
       "  0     4.3701  48231.39  378538.641  \n",
       "  1     1.1012  45510.24  349243.253  \n",
       "  2     6.1699  40116.85  298893.827  \n",
       "  3    -8.5534  45608.24  338125.593  \n",
       "  4     0.9493  46867.92  367416.632  \n",
       "  5     4.1300  36207.00  275623.622  \n",
       "  6     4.3521  29076.21  212671.328  \n",
       "  7    -0.0424  34827.97  242427.871  \n",
       "  8     2.0614  37857.31  265442.956  \n",
       "  9    -9.9909  51816.84  377971.397  \n",
       "  10    1.7023  37215.87  286581.438  \n",
       "  11   -1.9537  35784.18  271008.151  \n",
       "  12    4.3050  43903.29  333576.063  \n",
       "  13    0.6793  46695.92  347164.239  \n",
       "  14    3.4289  54826.16  399887.616  \n",
       "  15   -1.2901  34518.84  246140.556  \n",
       "  16    1.3924  59030.63  423139.793  \n",
       "  17   -0.9473  49749.56  351523.864  \n",
       "  18   -0.0139  44320.35  317241.463  \n",
       "  19   -4.2800  49920.29  363465.213  \n",
       "  20   -2.5468  47894.86  358618.948  \n",
       "  21    0.5750  40548.34  315525.626  \n",
       "  22    7.1859  47526.42  354810.200  \n",
       "  23    0.2669  40287.73  286346.167  \n",
       "  24    6.2687  57229.92  404187.925  \n",
       "  25    0.0597  39436.54  264723.283  \n",
       "  26    4.2341  43957.20  292223.754  \n",
       "  27   -4.7026  48086.17  312153.061  \n",
       "  28    1.2466  55550.50  376356.761  \n",
       "  29    5.4315  62299.90  409306.837  \n",
       "  ..       ...       ...         ...  \n",
       "  108   3.0600  30280.41  231242.088  \n",
       "  109  -2.6649  19756.40  149537.734  \n",
       "  110   3.7544  34274.17  258686.548  \n",
       "  111   4.6376  27209.04  196803.405  \n",
       "  112  -1.8650  20343.83  144420.399  \n",
       "  113  -2.3645  26674.79  190896.996  \n",
       "  114   2.3932  25678.04  186308.143  \n",
       "  115  -1.3588  19281.82  138777.567  \n",
       "  116   2.6197  24315.64  174276.638  \n",
       "  117   0.0423  21914.73  155197.042  \n",
       "  118   3.6058  31288.24  220797.919  \n",
       "  119   0.2488  29879.77  205348.741  \n",
       "  120   3.1396  25455.97  175732.051  \n",
       "  121  -7.3427  18990.64  127046.187  \n",
       "  122  -2.7079  14670.38  105782.775  \n",
       "  123   1.4215  15989.18  116601.304  \n",
       "  124  -0.0552  17150.28  125361.676  \n",
       "  125  -0.5351  18302.43  131931.476  \n",
       "  126   1.0677  14616.00  106157.056  \n",
       "  127   4.5217  24199.46  172582.069  \n",
       "  128   1.3514   9219.60   63364.993  \n",
       "  129  -3.0199  15749.27  107931.580  \n",
       "  130   1.5331  12982.12   90079.785  \n",
       "  131   0.2756   7331.40   50582.956  \n",
       "  132   3.1105  15907.71  109182.689  \n",
       "  133  -0.9333  10127.58   67835.534  \n",
       "  134   4.1185  22472.05  149042.950  \n",
       "  135  -3.1955  20209.69  131276.340  \n",
       "  136   0.2995   9629.20   64442.805  \n",
       "  137  -0.0748  11580.00   77024.479  \n",
       "  \n",
       "  [138 rows x 11 columns]),\n",
       " ('603288.SH',\n",
       "       trade_date    ts_code    open    high     low   close  pre_close  change  \\\n",
       "  276    20200729  603288.SH  145.14  148.80  143.79  148.60     146.19    2.41   \n",
       "  277    20200728  603288.SH  145.90  152.00  145.00  146.19     144.99    1.20   \n",
       "  278    20200727  603288.SH  138.43  145.42  136.83  144.99     137.07    7.92   \n",
       "  279    20200724  603288.SH  140.70  140.97  136.25  137.07     140.70   -3.63   \n",
       "  280    20200723  603288.SH  134.99  142.43  134.00  140.70     135.88    4.82   \n",
       "  281    20200722  603288.SH  134.18  136.87  133.10  135.88     135.54    0.34   \n",
       "  282    20200721  603288.SH  132.00  135.99  130.24  135.54     130.95    4.59   \n",
       "  283    20200720  603288.SH  131.45  132.97  128.40  130.95     130.10    0.85   \n",
       "  284    20200717  603288.SH  127.00  131.31  127.00  130.10     127.00    3.10   \n",
       "  285    20200716  603288.SH  133.80  133.80  126.00  127.00     134.16   -7.16   \n",
       "  286    20200715  603288.SH  131.20  135.75  130.02  134.16     130.60    3.56   \n",
       "  287    20200714  603288.SH  131.34  132.35  128.70  130.60     131.37   -0.77   \n",
       "  288    20200713  603288.SH  130.00  132.48  129.38  131.37     130.24    1.13   \n",
       "  289    20200710  603288.SH  127.77  132.40  127.50  130.24     128.64    1.60   \n",
       "  290    20200709  603288.SH  127.77  129.08  126.60  128.64     127.77    0.87   \n",
       "  291    20200708  603288.SH  129.10  129.86  126.60  127.77     128.05   -0.28   \n",
       "  292    20200707  603288.SH  124.45  131.77  124.01  128.05     124.44    3.61   \n",
       "  293    20200706  603288.SH  123.55  125.50  123.33  124.44     124.35    0.09   \n",
       "  294    20200703  603288.SH  124.01  124.77  122.80  124.35     124.00    0.35   \n",
       "  295    20200702  603288.SH  127.50  127.98  123.00  124.00     125.00   -1.00   \n",
       "  296    20200701  603288.SH  124.00  125.29  122.99  125.00     124.40    0.60   \n",
       "  297    20200630  603288.SH  124.64  124.78  122.86  124.40     124.65   -0.25   \n",
       "  298    20200629  603288.SH  123.79  125.30  122.62  124.65     123.80    0.85   \n",
       "  299    20200624  603288.SH  121.90  124.00  121.00  123.80     121.30    2.50   \n",
       "  300    20200623  603288.SH  118.15  121.34  117.81  121.30     117.89    3.41   \n",
       "  301    20200622  603288.SH  119.50  119.87  117.22  117.89     119.39   -1.50   \n",
       "  302    20200619  603288.SH  117.00  120.50  116.82  119.39     116.63    2.76   \n",
       "  303    20200618  603288.SH  116.30  116.88  115.06  116.63     115.85    0.78   \n",
       "  304    20200617  603288.SH  117.00  117.00  113.52  115.85     116.22   -0.37   \n",
       "  305    20200616  603288.SH  115.25  116.92  114.27  116.22     114.01    2.21   \n",
       "  ..          ...        ...     ...     ...     ...     ...        ...     ...   \n",
       "  384    20200220  603288.SH  104.00  106.38  103.40  105.88     103.84    2.04   \n",
       "  385    20200219  603288.SH  103.00  104.45  102.90  103.84     103.38    0.46   \n",
       "  386    20200218  603288.SH  104.90  105.29  102.87  103.38     105.37   -1.99   \n",
       "  387    20200217  603288.SH  105.15  106.19  104.50  105.37     104.70    0.67   \n",
       "  388    20200214  603288.SH  104.89  105.93  104.08  104.70     104.70    0.00   \n",
       "  389    20200213  603288.SH  107.00  107.37  104.50  104.70     107.08   -2.38   \n",
       "  390    20200212  603288.SH  106.30  108.29  106.30  107.08     107.00    0.08   \n",
       "  391    20200211  603288.SH  105.00  107.03  105.00  107.00     105.80    1.20   \n",
       "  392    20200210  603288.SH  105.60  106.57  105.10  105.80     106.50   -0.70   \n",
       "  393    20200207  603288.SH  104.58  107.08  103.48  106.50     105.25    1.25   \n",
       "  394    20200206  603288.SH  104.17  106.30  102.50  105.25     104.00    1.25   \n",
       "  395    20200205  603288.SH  102.68  104.20  100.70  104.00     102.68    1.32   \n",
       "  396    20200204  603288.SH  102.50  104.04  100.80  102.68     101.83    0.85   \n",
       "  397    20200203  603288.SH   96.49  102.04   96.49  101.83     107.21   -5.38   \n",
       "  398    20200123  603288.SH  109.95  109.95  106.02  107.21     109.74   -2.53   \n",
       "  399    20200122  603288.SH  111.60  111.60  109.02  109.74     111.95   -2.21   \n",
       "  400    20200121  603288.SH  111.30  112.70  109.00  111.95     112.05   -0.10   \n",
       "  401    20200120  603288.SH  110.08  112.45  108.76  112.05     109.86    2.19   \n",
       "  402    20200117  603288.SH  108.48  109.94  107.27  109.86     108.49    1.37   \n",
       "  403    20200116  603288.SH  108.00  108.51  106.17  108.49     107.37    1.12   \n",
       "  404    20200115  603288.SH  105.90  107.89  105.50  107.37     105.90    1.47   \n",
       "  405    20200114  603288.SH  108.88  109.50  105.80  105.90     108.30   -2.40   \n",
       "  406    20200113  603288.SH  108.76  108.94  107.40  108.30     107.96    0.34   \n",
       "  407    20200110  603288.SH  108.30  108.66  107.00  107.96     107.79    0.17   \n",
       "  408    20200109  603288.SH  106.45  108.00  106.45  107.79     106.17    1.62   \n",
       "  409    20200108  603288.SH  106.00  106.73  105.02  106.17     106.00    0.17   \n",
       "  410    20200107  603288.SH  103.83  106.00  103.83  106.00     103.62    2.38   \n",
       "  411    20200106  603288.SH  104.72  104.98  103.31  103.62     105.41   -1.79   \n",
       "  412    20200103  603288.SH  108.50  108.60  104.00  105.41     108.00   -2.59   \n",
       "  413    20200102  603288.SH  107.75  109.91  107.58  108.00     107.51    0.49   \n",
       "  \n",
       "       pct_chg        vol       amount  \n",
       "  276   1.6485   54572.25   798579.731  \n",
       "  277   0.8276   77218.48  1141693.510  \n",
       "  278   5.7781   72742.60  1037050.820  \n",
       "  279  -2.5800   64806.80   896881.888  \n",
       "  280   3.5472   82828.48  1156858.738  \n",
       "  281   0.2508   53841.98   729364.010  \n",
       "  282   3.5052   59911.70   806762.766  \n",
       "  283   0.6533   46782.34   611273.935  \n",
       "  284   2.4409   53468.21   692144.968  \n",
       "  285  -5.3369   86302.76  1115289.240  \n",
       "  286   2.7259   79041.38  1052996.487  \n",
       "  287  -0.5861   51249.03   669211.267  \n",
       "  288   0.8676   60639.27   797623.555  \n",
       "  289   1.2438   60832.80   793420.997  \n",
       "  290   0.6809   51845.63   662460.070  \n",
       "  291  -0.2187   63822.19   814191.193  \n",
       "  292   2.9010  108624.68  1393183.715  \n",
       "  293   0.0724   82996.00  1031734.270  \n",
       "  294   0.2823   51844.65   642209.904  \n",
       "  295  -0.8000   90276.82  1128277.402  \n",
       "  296   0.4823   42430.30   527650.641  \n",
       "  297  -0.2006   37871.06   468710.066  \n",
       "  298   0.6866   50701.97   628353.233  \n",
       "  299   2.0610   55898.73   686368.486  \n",
       "  300   2.8925   65239.66   783362.708  \n",
       "  301  -1.2564   47540.56   561091.361  \n",
       "  302   2.3665   72058.18   859236.308  \n",
       "  303   0.6733   40049.71   465653.003  \n",
       "  304  -0.3184   56720.06   650943.201  \n",
       "  305   1.9384   62025.89   718722.602  \n",
       "  ..       ...        ...          ...  \n",
       "  384   1.9646   47228.15   498134.688  \n",
       "  385   0.4450   31246.50   324778.642  \n",
       "  386  -1.8886   49676.82   514002.851  \n",
       "  387   0.6399   26878.00   283022.689  \n",
       "  388   0.0000   22814.55   239519.343  \n",
       "  389  -2.2226   33183.20   349478.085  \n",
       "  390   0.0748   29767.54   318543.203  \n",
       "  391   1.1342   35313.92   375073.575  \n",
       "  392  -0.6573   28737.97   304402.656  \n",
       "  393   1.1876   36723.57   385546.260  \n",
       "  394   1.2019   48135.25   504796.299  \n",
       "  395   1.2855   47074.85   481037.932  \n",
       "  396   0.8347   59751.65   610398.849  \n",
       "  397  -5.0182   84424.04   838318.029  \n",
       "  398  -2.3054   46158.31   496066.130  \n",
       "  399  -1.9741   39103.60   428874.296  \n",
       "  400  -0.0892   42660.84   474806.222  \n",
       "  401   1.9934   42974.92   478950.689  \n",
       "  402   1.2628   38986.25   425364.039  \n",
       "  403   1.0431   32623.37   350442.761  \n",
       "  404   1.3881   31287.76   334933.935  \n",
       "  405  -2.2161   39365.89   420855.325  \n",
       "  406   0.3149   26702.57   288812.722  \n",
       "  407   0.1577   21766.19   234674.772  \n",
       "  408   1.5259   35130.86   377460.716  \n",
       "  409   0.1604   25883.10   274000.681  \n",
       "  410   2.2969   40213.70   423924.757  \n",
       "  411  -1.6981   50322.18   524145.305  \n",
       "  412  -2.3981   58963.77   623049.159  \n",
       "  413   0.4558   40725.22   442407.988  \n",
       "  \n",
       "  [138 rows x 11 columns])]"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv('multi_stock_data.csv')\n",
    "grouped = df.groupby('ts_code')\n",
    "list(grouped)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "转换成列表的形式后，可以看到，列表由5个元组组成，每个元组中，第一个元素是组别（这里是按照ts_code进行分组），第二个元素的是对应组别下的DataFrame.\n",
    "总结来说，groupby的过程就是将原有的DataFrame按照groupby的字段（这里是ts_code），划分为若干个分组DataFrame，被分为多少个组就有多少个分组DataFrame。所以说，在groupby之后的一系列操作（如agg、apply等），均是基于子DataFrame的操作。理解了这点，也就基本摸清了Pandas中groupby操作的主要原理。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### agg\n",
    "\n",
    "聚合操作是groupby后非常常见的操作。聚合操作可以用来求和、均值、最大值、最小值等"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>close</th>\n",
       "      <th>open</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ts_code</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>002350.SZ</th>\n",
       "      <td>5.705693</td>\n",
       "      <td>5.683650</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002660.SZ</th>\n",
       "      <td>9.363551</td>\n",
       "      <td>9.331304</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002747.SZ</th>\n",
       "      <td>11.567029</td>\n",
       "      <td>11.520072</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>300685.SZ</th>\n",
       "      <td>75.799058</td>\n",
       "      <td>75.513623</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>603288.SH</th>\n",
       "      <td>115.442319</td>\n",
       "      <td>114.868841</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                close        open\n",
       "ts_code                          \n",
       "002350.SZ    5.705693    5.683650\n",
       "002660.SZ    9.363551    9.331304\n",
       "002747.SZ   11.567029   11.520072\n",
       "300685.SZ   75.799058   75.513623\n",
       "603288.SH  115.442319  114.868841"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mean_perform = df.groupby('ts_code')['close','open'].agg('mean')\n",
    "mean_perform"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>close</th>\n",
       "      <th>open</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ts_code</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>002350.SZ</th>\n",
       "      <td>5.705693</td>\n",
       "      <td>5.660</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002660.SZ</th>\n",
       "      <td>9.363551</td>\n",
       "      <td>9.280</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>002747.SZ</th>\n",
       "      <td>11.567029</td>\n",
       "      <td>11.080</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>300685.SZ</th>\n",
       "      <td>75.799058</td>\n",
       "      <td>73.995</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>603288.SH</th>\n",
       "      <td>115.442319</td>\n",
       "      <td>113.960</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                close     open\n",
       "ts_code                       \n",
       "002350.SZ    5.705693    5.660\n",
       "002660.SZ    9.363551    9.280\n",
       "002747.SZ   11.567029   11.080\n",
       "300685.SZ   75.799058   73.995\n",
       "603288.SH  115.442319  113.960"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "some_perform = df.groupby('ts_code')['close','open'].agg({'close':'mean', 'open':'median'})\n",
    "some_perform"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### transform\n",
    "对transform而言，则会对每一条数据求得相应的结果，同一组内的样本会有相同的值，组内求完均值后会按照原索引的顺序返回结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>trade_date</th>\n",
       "      <th>ts_code</th>\n",
       "      <th>open</th>\n",
       "      <th>high</th>\n",
       "      <th>low</th>\n",
       "      <th>close</th>\n",
       "      <th>pre_close</th>\n",
       "      <th>change</th>\n",
       "      <th>pct_chg</th>\n",
       "      <th>vol</th>\n",
       "      <th>amount</th>\n",
       "      <th>avg_close</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>20200729</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.88</td>\n",
       "      <td>80.50</td>\n",
       "      <td>75.22</td>\n",
       "      <td>79.53</td>\n",
       "      <td>76.20</td>\n",
       "      <td>3.33</td>\n",
       "      <td>4.3701</td>\n",
       "      <td>48231.39</td>\n",
       "      <td>378538.641</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20200728</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.24</td>\n",
       "      <td>79.43</td>\n",
       "      <td>74.99</td>\n",
       "      <td>76.20</td>\n",
       "      <td>75.37</td>\n",
       "      <td>0.83</td>\n",
       "      <td>1.1012</td>\n",
       "      <td>45510.24</td>\n",
       "      <td>349243.253</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>20200727</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>71.84</td>\n",
       "      <td>75.99</td>\n",
       "      <td>71.09</td>\n",
       "      <td>75.37</td>\n",
       "      <td>70.99</td>\n",
       "      <td>4.38</td>\n",
       "      <td>6.1699</td>\n",
       "      <td>40116.85</td>\n",
       "      <td>298893.827</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>20200724</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.56</td>\n",
       "      <td>78.44</td>\n",
       "      <td>70.00</td>\n",
       "      <td>70.99</td>\n",
       "      <td>77.63</td>\n",
       "      <td>-6.64</td>\n",
       "      <td>-8.5534</td>\n",
       "      <td>45608.24</td>\n",
       "      <td>338125.593</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>20200723</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.70</td>\n",
       "      <td>80.80</td>\n",
       "      <td>76.41</td>\n",
       "      <td>77.63</td>\n",
       "      <td>76.90</td>\n",
       "      <td>0.73</td>\n",
       "      <td>0.9493</td>\n",
       "      <td>46867.92</td>\n",
       "      <td>367416.632</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>20200722</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>73.83</td>\n",
       "      <td>77.59</td>\n",
       "      <td>72.92</td>\n",
       "      <td>76.90</td>\n",
       "      <td>73.85</td>\n",
       "      <td>3.05</td>\n",
       "      <td>4.1300</td>\n",
       "      <td>36207.00</td>\n",
       "      <td>275623.622</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>20200721</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>70.61</td>\n",
       "      <td>74.50</td>\n",
       "      <td>69.50</td>\n",
       "      <td>73.85</td>\n",
       "      <td>70.77</td>\n",
       "      <td>3.08</td>\n",
       "      <td>4.3521</td>\n",
       "      <td>29076.21</td>\n",
       "      <td>212671.328</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>20200720</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>71.98</td>\n",
       "      <td>71.99</td>\n",
       "      <td>67.18</td>\n",
       "      <td>70.77</td>\n",
       "      <td>70.80</td>\n",
       "      <td>-0.03</td>\n",
       "      <td>-0.0424</td>\n",
       "      <td>34827.97</td>\n",
       "      <td>242427.871</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>20200717</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>69.76</td>\n",
       "      <td>72.13</td>\n",
       "      <td>68.64</td>\n",
       "      <td>70.80</td>\n",
       "      <td>69.37</td>\n",
       "      <td>1.43</td>\n",
       "      <td>2.0614</td>\n",
       "      <td>37857.31</td>\n",
       "      <td>265442.956</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>20200716</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>78.00</td>\n",
       "      <td>78.26</td>\n",
       "      <td>69.36</td>\n",
       "      <td>69.37</td>\n",
       "      <td>77.07</td>\n",
       "      <td>-7.70</td>\n",
       "      <td>-9.9909</td>\n",
       "      <td>51816.84</td>\n",
       "      <td>377971.397</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>20200715</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>75.60</td>\n",
       "      <td>78.68</td>\n",
       "      <td>75.49</td>\n",
       "      <td>77.07</td>\n",
       "      <td>75.78</td>\n",
       "      <td>1.29</td>\n",
       "      <td>1.7023</td>\n",
       "      <td>37215.87</td>\n",
       "      <td>286581.438</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>20200714</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.73</td>\n",
       "      <td>78.00</td>\n",
       "      <td>73.00</td>\n",
       "      <td>75.78</td>\n",
       "      <td>77.29</td>\n",
       "      <td>-1.51</td>\n",
       "      <td>-1.9537</td>\n",
       "      <td>35784.18</td>\n",
       "      <td>271008.151</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>20200713</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>75.98</td>\n",
       "      <td>77.35</td>\n",
       "      <td>74.30</td>\n",
       "      <td>77.29</td>\n",
       "      <td>74.10</td>\n",
       "      <td>3.19</td>\n",
       "      <td>4.3050</td>\n",
       "      <td>43903.29</td>\n",
       "      <td>333576.063</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>20200710</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>73.75</td>\n",
       "      <td>75.86</td>\n",
       "      <td>72.90</td>\n",
       "      <td>74.10</td>\n",
       "      <td>73.60</td>\n",
       "      <td>0.50</td>\n",
       "      <td>0.6793</td>\n",
       "      <td>46695.92</td>\n",
       "      <td>347164.239</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>20200709</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>71.10</td>\n",
       "      <td>73.65</td>\n",
       "      <td>70.00</td>\n",
       "      <td>73.60</td>\n",
       "      <td>71.16</td>\n",
       "      <td>2.44</td>\n",
       "      <td>3.4289</td>\n",
       "      <td>54826.16</td>\n",
       "      <td>399887.616</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>20200708</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>72.27</td>\n",
       "      <td>72.74</td>\n",
       "      <td>70.35</td>\n",
       "      <td>71.16</td>\n",
       "      <td>72.09</td>\n",
       "      <td>-0.93</td>\n",
       "      <td>-1.2901</td>\n",
       "      <td>34518.84</td>\n",
       "      <td>246140.556</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>20200707</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>70.00</td>\n",
       "      <td>73.43</td>\n",
       "      <td>68.70</td>\n",
       "      <td>72.09</td>\n",
       "      <td>71.10</td>\n",
       "      <td>0.99</td>\n",
       "      <td>1.3924</td>\n",
       "      <td>59030.63</td>\n",
       "      <td>423139.793</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>20200706</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>71.02</td>\n",
       "      <td>71.79</td>\n",
       "      <td>68.88</td>\n",
       "      <td>71.10</td>\n",
       "      <td>71.78</td>\n",
       "      <td>-0.68</td>\n",
       "      <td>-0.9473</td>\n",
       "      <td>49749.56</td>\n",
       "      <td>351523.864</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>20200703</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>72.50</td>\n",
       "      <td>73.10</td>\n",
       "      <td>70.00</td>\n",
       "      <td>71.78</td>\n",
       "      <td>71.79</td>\n",
       "      <td>-0.01</td>\n",
       "      <td>-0.0139</td>\n",
       "      <td>44320.35</td>\n",
       "      <td>317241.463</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>20200702</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>75.13</td>\n",
       "      <td>75.97</td>\n",
       "      <td>71.25</td>\n",
       "      <td>71.79</td>\n",
       "      <td>75.00</td>\n",
       "      <td>-3.21</td>\n",
       "      <td>-4.2800</td>\n",
       "      <td>49920.29</td>\n",
       "      <td>363465.213</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>20200701</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>77.12</td>\n",
       "      <td>78.26</td>\n",
       "      <td>72.39</td>\n",
       "      <td>75.00</td>\n",
       "      <td>76.96</td>\n",
       "      <td>-1.96</td>\n",
       "      <td>-2.5468</td>\n",
       "      <td>47894.86</td>\n",
       "      <td>358618.948</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>20200630</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>76.30</td>\n",
       "      <td>79.95</td>\n",
       "      <td>75.58</td>\n",
       "      <td>76.96</td>\n",
       "      <td>76.52</td>\n",
       "      <td>0.44</td>\n",
       "      <td>0.5750</td>\n",
       "      <td>40548.34</td>\n",
       "      <td>315525.626</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>20200629</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>70.90</td>\n",
       "      <td>77.39</td>\n",
       "      <td>70.33</td>\n",
       "      <td>76.52</td>\n",
       "      <td>71.39</td>\n",
       "      <td>5.13</td>\n",
       "      <td>7.1859</td>\n",
       "      <td>47526.42</td>\n",
       "      <td>354810.200</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>20200624</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>71.10</td>\n",
       "      <td>71.91</td>\n",
       "      <td>69.80</td>\n",
       "      <td>71.39</td>\n",
       "      <td>71.20</td>\n",
       "      <td>0.19</td>\n",
       "      <td>0.2669</td>\n",
       "      <td>40287.73</td>\n",
       "      <td>286346.167</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>20200623</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>68.28</td>\n",
       "      <td>71.80</td>\n",
       "      <td>68.28</td>\n",
       "      <td>71.20</td>\n",
       "      <td>67.00</td>\n",
       "      <td>4.20</td>\n",
       "      <td>6.2687</td>\n",
       "      <td>57229.92</td>\n",
       "      <td>404187.925</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>20200622</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>66.91</td>\n",
       "      <td>68.40</td>\n",
       "      <td>66.01</td>\n",
       "      <td>67.00</td>\n",
       "      <td>66.96</td>\n",
       "      <td>0.04</td>\n",
       "      <td>0.0597</td>\n",
       "      <td>39436.54</td>\n",
       "      <td>264723.283</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>20200619</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>65.37</td>\n",
       "      <td>67.45</td>\n",
       "      <td>64.30</td>\n",
       "      <td>66.96</td>\n",
       "      <td>64.24</td>\n",
       "      <td>2.72</td>\n",
       "      <td>4.2341</td>\n",
       "      <td>43957.20</td>\n",
       "      <td>292223.754</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>20200618</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>66.99</td>\n",
       "      <td>67.66</td>\n",
       "      <td>63.72</td>\n",
       "      <td>64.24</td>\n",
       "      <td>67.41</td>\n",
       "      <td>-3.17</td>\n",
       "      <td>-4.7026</td>\n",
       "      <td>48086.17</td>\n",
       "      <td>312153.061</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>20200617</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>67.00</td>\n",
       "      <td>69.19</td>\n",
       "      <td>66.23</td>\n",
       "      <td>67.41</td>\n",
       "      <td>66.58</td>\n",
       "      <td>0.83</td>\n",
       "      <td>1.2466</td>\n",
       "      <td>55550.50</td>\n",
       "      <td>376356.761</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>20200616</td>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>63.63</td>\n",
       "      <td>67.79</td>\n",
       "      <td>62.28</td>\n",
       "      <td>66.58</td>\n",
       "      <td>63.15</td>\n",
       "      <td>3.43</td>\n",
       "      <td>5.4315</td>\n",
       "      <td>62299.90</td>\n",
       "      <td>409306.837</td>\n",
       "      <td>75.799058</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>659</th>\n",
       "      <td>20200220</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.07</td>\n",
       "      <td>6.23</td>\n",
       "      <td>5.94</td>\n",
       "      <td>6.20</td>\n",
       "      <td>6.08</td>\n",
       "      <td>0.12</td>\n",
       "      <td>1.9737</td>\n",
       "      <td>136050.11</td>\n",
       "      <td>83301.161</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>660</th>\n",
       "      <td>20200219</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.23</td>\n",
       "      <td>6.26</td>\n",
       "      <td>6.04</td>\n",
       "      <td>6.08</td>\n",
       "      <td>6.28</td>\n",
       "      <td>-0.20</td>\n",
       "      <td>-3.1847</td>\n",
       "      <td>126933.50</td>\n",
       "      <td>78189.836</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>661</th>\n",
       "      <td>20200218</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.10</td>\n",
       "      <td>6.39</td>\n",
       "      <td>6.06</td>\n",
       "      <td>6.28</td>\n",
       "      <td>6.16</td>\n",
       "      <td>0.12</td>\n",
       "      <td>1.9481</td>\n",
       "      <td>174172.50</td>\n",
       "      <td>108591.280</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>662</th>\n",
       "      <td>20200217</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.00</td>\n",
       "      <td>6.17</td>\n",
       "      <td>5.95</td>\n",
       "      <td>6.16</td>\n",
       "      <td>6.06</td>\n",
       "      <td>0.10</td>\n",
       "      <td>1.6502</td>\n",
       "      <td>126684.60</td>\n",
       "      <td>76711.019</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>663</th>\n",
       "      <td>20200214</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.79</td>\n",
       "      <td>6.19</td>\n",
       "      <td>5.71</td>\n",
       "      <td>6.06</td>\n",
       "      <td>5.99</td>\n",
       "      <td>0.07</td>\n",
       "      <td>1.1686</td>\n",
       "      <td>160717.53</td>\n",
       "      <td>95509.993</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>664</th>\n",
       "      <td>20200213</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.20</td>\n",
       "      <td>6.44</td>\n",
       "      <td>5.99</td>\n",
       "      <td>5.99</td>\n",
       "      <td>5.92</td>\n",
       "      <td>0.07</td>\n",
       "      <td>1.1824</td>\n",
       "      <td>280371.90</td>\n",
       "      <td>173459.234</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>665</th>\n",
       "      <td>20200212</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.46</td>\n",
       "      <td>5.92</td>\n",
       "      <td>5.45</td>\n",
       "      <td>5.92</td>\n",
       "      <td>5.38</td>\n",
       "      <td>0.54</td>\n",
       "      <td>10.0372</td>\n",
       "      <td>155563.45</td>\n",
       "      <td>89984.065</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>666</th>\n",
       "      <td>20200211</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.47</td>\n",
       "      <td>5.49</td>\n",
       "      <td>5.37</td>\n",
       "      <td>5.38</td>\n",
       "      <td>5.47</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-1.6453</td>\n",
       "      <td>39459.27</td>\n",
       "      <td>21350.565</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>667</th>\n",
       "      <td>20200210</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.32</td>\n",
       "      <td>5.47</td>\n",
       "      <td>5.27</td>\n",
       "      <td>5.47</td>\n",
       "      <td>5.32</td>\n",
       "      <td>0.15</td>\n",
       "      <td>2.8195</td>\n",
       "      <td>46564.08</td>\n",
       "      <td>25228.387</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>668</th>\n",
       "      <td>20200207</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.19</td>\n",
       "      <td>5.34</td>\n",
       "      <td>5.13</td>\n",
       "      <td>5.32</td>\n",
       "      <td>5.19</td>\n",
       "      <td>0.13</td>\n",
       "      <td>2.5048</td>\n",
       "      <td>53671.38</td>\n",
       "      <td>28235.062</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>669</th>\n",
       "      <td>20200206</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.11</td>\n",
       "      <td>5.22</td>\n",
       "      <td>5.10</td>\n",
       "      <td>5.19</td>\n",
       "      <td>5.14</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.9728</td>\n",
       "      <td>50352.95</td>\n",
       "      <td>26031.271</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>670</th>\n",
       "      <td>20200205</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.09</td>\n",
       "      <td>5.23</td>\n",
       "      <td>5.09</td>\n",
       "      <td>5.14</td>\n",
       "      <td>5.08</td>\n",
       "      <td>0.06</td>\n",
       "      <td>1.1811</td>\n",
       "      <td>47655.51</td>\n",
       "      <td>24578.871</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>671</th>\n",
       "      <td>20200204</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>4.72</td>\n",
       "      <td>5.23</td>\n",
       "      <td>4.72</td>\n",
       "      <td>5.08</td>\n",
       "      <td>5.24</td>\n",
       "      <td>-0.16</td>\n",
       "      <td>-3.0534</td>\n",
       "      <td>77073.61</td>\n",
       "      <td>38838.267</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>672</th>\n",
       "      <td>20200203</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.24</td>\n",
       "      <td>5.24</td>\n",
       "      <td>5.24</td>\n",
       "      <td>5.24</td>\n",
       "      <td>5.82</td>\n",
       "      <td>-0.58</td>\n",
       "      <td>-9.9656</td>\n",
       "      <td>11901.00</td>\n",
       "      <td>6236.124</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>673</th>\n",
       "      <td>20200123</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.98</td>\n",
       "      <td>6.02</td>\n",
       "      <td>5.74</td>\n",
       "      <td>5.82</td>\n",
       "      <td>5.99</td>\n",
       "      <td>-0.17</td>\n",
       "      <td>-2.8381</td>\n",
       "      <td>48644.92</td>\n",
       "      <td>28534.580</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>674</th>\n",
       "      <td>20200122</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.92</td>\n",
       "      <td>6.07</td>\n",
       "      <td>5.83</td>\n",
       "      <td>5.99</td>\n",
       "      <td>6.00</td>\n",
       "      <td>-0.01</td>\n",
       "      <td>-0.1667</td>\n",
       "      <td>48130.38</td>\n",
       "      <td>28812.409</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>675</th>\n",
       "      <td>20200121</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.16</td>\n",
       "      <td>6.17</td>\n",
       "      <td>5.96</td>\n",
       "      <td>6.00</td>\n",
       "      <td>6.15</td>\n",
       "      <td>-0.15</td>\n",
       "      <td>-2.4390</td>\n",
       "      <td>57842.42</td>\n",
       "      <td>34871.239</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>676</th>\n",
       "      <td>20200120</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.08</td>\n",
       "      <td>6.16</td>\n",
       "      <td>6.05</td>\n",
       "      <td>6.15</td>\n",
       "      <td>6.10</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.8197</td>\n",
       "      <td>49417.89</td>\n",
       "      <td>30162.397</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>677</th>\n",
       "      <td>20200117</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.14</td>\n",
       "      <td>6.22</td>\n",
       "      <td>6.10</td>\n",
       "      <td>6.10</td>\n",
       "      <td>6.19</td>\n",
       "      <td>-0.09</td>\n",
       "      <td>-1.4540</td>\n",
       "      <td>59659.40</td>\n",
       "      <td>36665.953</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>678</th>\n",
       "      <td>20200116</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.34</td>\n",
       "      <td>6.34</td>\n",
       "      <td>6.19</td>\n",
       "      <td>6.19</td>\n",
       "      <td>6.36</td>\n",
       "      <td>-0.17</td>\n",
       "      <td>-2.6730</td>\n",
       "      <td>78552.90</td>\n",
       "      <td>48990.967</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>679</th>\n",
       "      <td>20200115</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.55</td>\n",
       "      <td>6.60</td>\n",
       "      <td>6.25</td>\n",
       "      <td>6.36</td>\n",
       "      <td>6.59</td>\n",
       "      <td>-0.23</td>\n",
       "      <td>-3.4901</td>\n",
       "      <td>148040.02</td>\n",
       "      <td>93985.570</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>680</th>\n",
       "      <td>20200114</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.48</td>\n",
       "      <td>6.92</td>\n",
       "      <td>6.45</td>\n",
       "      <td>6.59</td>\n",
       "      <td>6.54</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.7645</td>\n",
       "      <td>211606.87</td>\n",
       "      <td>141252.242</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>681</th>\n",
       "      <td>20200113</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.50</td>\n",
       "      <td>6.62</td>\n",
       "      <td>6.41</td>\n",
       "      <td>6.54</td>\n",
       "      <td>6.71</td>\n",
       "      <td>-0.17</td>\n",
       "      <td>-2.5335</td>\n",
       "      <td>260810.94</td>\n",
       "      <td>169894.614</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>682</th>\n",
       "      <td>20200110</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.05</td>\n",
       "      <td>6.71</td>\n",
       "      <td>5.97</td>\n",
       "      <td>6.71</td>\n",
       "      <td>6.10</td>\n",
       "      <td>0.61</td>\n",
       "      <td>10.0000</td>\n",
       "      <td>332168.68</td>\n",
       "      <td>215221.161</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>683</th>\n",
       "      <td>20200109</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.28</td>\n",
       "      <td>6.37</td>\n",
       "      <td>5.92</td>\n",
       "      <td>6.10</td>\n",
       "      <td>6.05</td>\n",
       "      <td>0.05</td>\n",
       "      <td>0.8264</td>\n",
       "      <td>140280.25</td>\n",
       "      <td>85630.713</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>684</th>\n",
       "      <td>20200108</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>6.20</td>\n",
       "      <td>6.52</td>\n",
       "      <td>6.01</td>\n",
       "      <td>6.05</td>\n",
       "      <td>5.93</td>\n",
       "      <td>0.12</td>\n",
       "      <td>2.0236</td>\n",
       "      <td>182015.88</td>\n",
       "      <td>111934.573</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>685</th>\n",
       "      <td>20200107</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.75</td>\n",
       "      <td>6.07</td>\n",
       "      <td>5.75</td>\n",
       "      <td>5.93</td>\n",
       "      <td>5.72</td>\n",
       "      <td>0.21</td>\n",
       "      <td>3.6713</td>\n",
       "      <td>101464.57</td>\n",
       "      <td>59886.982</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>686</th>\n",
       "      <td>20200106</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.65</td>\n",
       "      <td>5.74</td>\n",
       "      <td>5.65</td>\n",
       "      <td>5.72</td>\n",
       "      <td>5.69</td>\n",
       "      <td>0.03</td>\n",
       "      <td>0.5272</td>\n",
       "      <td>28396.10</td>\n",
       "      <td>16216.815</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>687</th>\n",
       "      <td>20200103</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.66</td>\n",
       "      <td>5.74</td>\n",
       "      <td>5.65</td>\n",
       "      <td>5.69</td>\n",
       "      <td>5.67</td>\n",
       "      <td>0.02</td>\n",
       "      <td>0.3527</td>\n",
       "      <td>23224.10</td>\n",
       "      <td>13208.640</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>688</th>\n",
       "      <td>20200102</td>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>5.65</td>\n",
       "      <td>5.68</td>\n",
       "      <td>5.60</td>\n",
       "      <td>5.67</td>\n",
       "      <td>5.60</td>\n",
       "      <td>0.07</td>\n",
       "      <td>1.2500</td>\n",
       "      <td>30157.31</td>\n",
       "      <td>17036.562</td>\n",
       "      <td>5.705693</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>689 rows × 12 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     trade_date    ts_code   open   high    low  close  pre_close  change  \\\n",
       "0      20200729  300685.SZ  76.88  80.50  75.22  79.53      76.20    3.33   \n",
       "1      20200728  300685.SZ  76.24  79.43  74.99  76.20      75.37    0.83   \n",
       "2      20200727  300685.SZ  71.84  75.99  71.09  75.37      70.99    4.38   \n",
       "3      20200724  300685.SZ  76.56  78.44  70.00  70.99      77.63   -6.64   \n",
       "4      20200723  300685.SZ  76.70  80.80  76.41  77.63      76.90    0.73   \n",
       "5      20200722  300685.SZ  73.83  77.59  72.92  76.90      73.85    3.05   \n",
       "6      20200721  300685.SZ  70.61  74.50  69.50  73.85      70.77    3.08   \n",
       "7      20200720  300685.SZ  71.98  71.99  67.18  70.77      70.80   -0.03   \n",
       "8      20200717  300685.SZ  69.76  72.13  68.64  70.80      69.37    1.43   \n",
       "9      20200716  300685.SZ  78.00  78.26  69.36  69.37      77.07   -7.70   \n",
       "10     20200715  300685.SZ  75.60  78.68  75.49  77.07      75.78    1.29   \n",
       "11     20200714  300685.SZ  76.73  78.00  73.00  75.78      77.29   -1.51   \n",
       "12     20200713  300685.SZ  75.98  77.35  74.30  77.29      74.10    3.19   \n",
       "13     20200710  300685.SZ  73.75  75.86  72.90  74.10      73.60    0.50   \n",
       "14     20200709  300685.SZ  71.10  73.65  70.00  73.60      71.16    2.44   \n",
       "15     20200708  300685.SZ  72.27  72.74  70.35  71.16      72.09   -0.93   \n",
       "16     20200707  300685.SZ  70.00  73.43  68.70  72.09      71.10    0.99   \n",
       "17     20200706  300685.SZ  71.02  71.79  68.88  71.10      71.78   -0.68   \n",
       "18     20200703  300685.SZ  72.50  73.10  70.00  71.78      71.79   -0.01   \n",
       "19     20200702  300685.SZ  75.13  75.97  71.25  71.79      75.00   -3.21   \n",
       "20     20200701  300685.SZ  77.12  78.26  72.39  75.00      76.96   -1.96   \n",
       "21     20200630  300685.SZ  76.30  79.95  75.58  76.96      76.52    0.44   \n",
       "22     20200629  300685.SZ  70.90  77.39  70.33  76.52      71.39    5.13   \n",
       "23     20200624  300685.SZ  71.10  71.91  69.80  71.39      71.20    0.19   \n",
       "24     20200623  300685.SZ  68.28  71.80  68.28  71.20      67.00    4.20   \n",
       "25     20200622  300685.SZ  66.91  68.40  66.01  67.00      66.96    0.04   \n",
       "26     20200619  300685.SZ  65.37  67.45  64.30  66.96      64.24    2.72   \n",
       "27     20200618  300685.SZ  66.99  67.66  63.72  64.24      67.41   -3.17   \n",
       "28     20200617  300685.SZ  67.00  69.19  66.23  67.41      66.58    0.83   \n",
       "29     20200616  300685.SZ  63.63  67.79  62.28  66.58      63.15    3.43   \n",
       "..          ...        ...    ...    ...    ...    ...        ...     ...   \n",
       "659    20200220  002350.SZ   6.07   6.23   5.94   6.20       6.08    0.12   \n",
       "660    20200219  002350.SZ   6.23   6.26   6.04   6.08       6.28   -0.20   \n",
       "661    20200218  002350.SZ   6.10   6.39   6.06   6.28       6.16    0.12   \n",
       "662    20200217  002350.SZ   6.00   6.17   5.95   6.16       6.06    0.10   \n",
       "663    20200214  002350.SZ   5.79   6.19   5.71   6.06       5.99    0.07   \n",
       "664    20200213  002350.SZ   6.20   6.44   5.99   5.99       5.92    0.07   \n",
       "665    20200212  002350.SZ   5.46   5.92   5.45   5.92       5.38    0.54   \n",
       "666    20200211  002350.SZ   5.47   5.49   5.37   5.38       5.47   -0.09   \n",
       "667    20200210  002350.SZ   5.32   5.47   5.27   5.47       5.32    0.15   \n",
       "668    20200207  002350.SZ   5.19   5.34   5.13   5.32       5.19    0.13   \n",
       "669    20200206  002350.SZ   5.11   5.22   5.10   5.19       5.14    0.05   \n",
       "670    20200205  002350.SZ   5.09   5.23   5.09   5.14       5.08    0.06   \n",
       "671    20200204  002350.SZ   4.72   5.23   4.72   5.08       5.24   -0.16   \n",
       "672    20200203  002350.SZ   5.24   5.24   5.24   5.24       5.82   -0.58   \n",
       "673    20200123  002350.SZ   5.98   6.02   5.74   5.82       5.99   -0.17   \n",
       "674    20200122  002350.SZ   5.92   6.07   5.83   5.99       6.00   -0.01   \n",
       "675    20200121  002350.SZ   6.16   6.17   5.96   6.00       6.15   -0.15   \n",
       "676    20200120  002350.SZ   6.08   6.16   6.05   6.15       6.10    0.05   \n",
       "677    20200117  002350.SZ   6.14   6.22   6.10   6.10       6.19   -0.09   \n",
       "678    20200116  002350.SZ   6.34   6.34   6.19   6.19       6.36   -0.17   \n",
       "679    20200115  002350.SZ   6.55   6.60   6.25   6.36       6.59   -0.23   \n",
       "680    20200114  002350.SZ   6.48   6.92   6.45   6.59       6.54    0.05   \n",
       "681    20200113  002350.SZ   6.50   6.62   6.41   6.54       6.71   -0.17   \n",
       "682    20200110  002350.SZ   6.05   6.71   5.97   6.71       6.10    0.61   \n",
       "683    20200109  002350.SZ   6.28   6.37   5.92   6.10       6.05    0.05   \n",
       "684    20200108  002350.SZ   6.20   6.52   6.01   6.05       5.93    0.12   \n",
       "685    20200107  002350.SZ   5.75   6.07   5.75   5.93       5.72    0.21   \n",
       "686    20200106  002350.SZ   5.65   5.74   5.65   5.72       5.69    0.03   \n",
       "687    20200103  002350.SZ   5.66   5.74   5.65   5.69       5.67    0.02   \n",
       "688    20200102  002350.SZ   5.65   5.68   5.60   5.67       5.60    0.07   \n",
       "\n",
       "     pct_chg        vol      amount  avg_close  \n",
       "0     4.3701   48231.39  378538.641  75.799058  \n",
       "1     1.1012   45510.24  349243.253  75.799058  \n",
       "2     6.1699   40116.85  298893.827  75.799058  \n",
       "3    -8.5534   45608.24  338125.593  75.799058  \n",
       "4     0.9493   46867.92  367416.632  75.799058  \n",
       "5     4.1300   36207.00  275623.622  75.799058  \n",
       "6     4.3521   29076.21  212671.328  75.799058  \n",
       "7    -0.0424   34827.97  242427.871  75.799058  \n",
       "8     2.0614   37857.31  265442.956  75.799058  \n",
       "9    -9.9909   51816.84  377971.397  75.799058  \n",
       "10    1.7023   37215.87  286581.438  75.799058  \n",
       "11   -1.9537   35784.18  271008.151  75.799058  \n",
       "12    4.3050   43903.29  333576.063  75.799058  \n",
       "13    0.6793   46695.92  347164.239  75.799058  \n",
       "14    3.4289   54826.16  399887.616  75.799058  \n",
       "15   -1.2901   34518.84  246140.556  75.799058  \n",
       "16    1.3924   59030.63  423139.793  75.799058  \n",
       "17   -0.9473   49749.56  351523.864  75.799058  \n",
       "18   -0.0139   44320.35  317241.463  75.799058  \n",
       "19   -4.2800   49920.29  363465.213  75.799058  \n",
       "20   -2.5468   47894.86  358618.948  75.799058  \n",
       "21    0.5750   40548.34  315525.626  75.799058  \n",
       "22    7.1859   47526.42  354810.200  75.799058  \n",
       "23    0.2669   40287.73  286346.167  75.799058  \n",
       "24    6.2687   57229.92  404187.925  75.799058  \n",
       "25    0.0597   39436.54  264723.283  75.799058  \n",
       "26    4.2341   43957.20  292223.754  75.799058  \n",
       "27   -4.7026   48086.17  312153.061  75.799058  \n",
       "28    1.2466   55550.50  376356.761  75.799058  \n",
       "29    5.4315   62299.90  409306.837  75.799058  \n",
       "..       ...        ...         ...        ...  \n",
       "659   1.9737  136050.11   83301.161   5.705693  \n",
       "660  -3.1847  126933.50   78189.836   5.705693  \n",
       "661   1.9481  174172.50  108591.280   5.705693  \n",
       "662   1.6502  126684.60   76711.019   5.705693  \n",
       "663   1.1686  160717.53   95509.993   5.705693  \n",
       "664   1.1824  280371.90  173459.234   5.705693  \n",
       "665  10.0372  155563.45   89984.065   5.705693  \n",
       "666  -1.6453   39459.27   21350.565   5.705693  \n",
       "667   2.8195   46564.08   25228.387   5.705693  \n",
       "668   2.5048   53671.38   28235.062   5.705693  \n",
       "669   0.9728   50352.95   26031.271   5.705693  \n",
       "670   1.1811   47655.51   24578.871   5.705693  \n",
       "671  -3.0534   77073.61   38838.267   5.705693  \n",
       "672  -9.9656   11901.00    6236.124   5.705693  \n",
       "673  -2.8381   48644.92   28534.580   5.705693  \n",
       "674  -0.1667   48130.38   28812.409   5.705693  \n",
       "675  -2.4390   57842.42   34871.239   5.705693  \n",
       "676   0.8197   49417.89   30162.397   5.705693  \n",
       "677  -1.4540   59659.40   36665.953   5.705693  \n",
       "678  -2.6730   78552.90   48990.967   5.705693  \n",
       "679  -3.4901  148040.02   93985.570   5.705693  \n",
       "680   0.7645  211606.87  141252.242   5.705693  \n",
       "681  -2.5335  260810.94  169894.614   5.705693  \n",
       "682  10.0000  332168.68  215221.161   5.705693  \n",
       "683   0.8264  140280.25   85630.713   5.705693  \n",
       "684   2.0236  182015.88  111934.573   5.705693  \n",
       "685   3.6713  101464.57   59886.982   5.705693  \n",
       "686   0.5272   28396.10   16216.815   5.705693  \n",
       "687   0.3527   23224.10   13208.640   5.705693  \n",
       "688   1.2500   30157.31   17036.562   5.705693  \n",
       "\n",
       "[689 rows x 12 columns]"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_trans = df\n",
    "df_trans['avg_close'] = df_trans.groupby('ts_code')['close'].transform('mean')\n",
    "df_trans"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 场景一\n",
    "\n",
    "我们拿到了一个数据集multi_stock_data.csv，里面包含着5个股票在2020年一段时间的日价格数据，我们想知道每个股票的最大涨幅（pct_chg）各自是多少？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>pct_chg</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>10.0372</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>002660.SZ</td>\n",
       "      <td>9.9886</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>10.0402</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>7.1859</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>603288.SH</td>\n",
       "      <td>10.0009</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     ts_code  pct_chg\n",
       "0  002350.SZ  10.0372\n",
       "1  002660.SZ   9.9886\n",
       "2  002747.SZ  10.0402\n",
       "3  300685.SZ   7.1859\n",
       "4  603288.SH  10.0009"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv('multi_stock_data.csv')\n",
    "best_perform = df.groupby('ts_code')['pct_chg'].apply(max).reset_index()\n",
    "best_perform"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 场景二\n",
    "\n",
    "我们拿到了5个股票在2020年一段时间的日价格数据，我们想知道每个股票的第二大交易发生在什么时间？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ts_code</th>\n",
       "      <th>trade_date</th>\n",
       "      <th>amount</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>002350.SZ</td>\n",
       "      <td>20200525.0</td>\n",
       "      <td>8886.508</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>002660.SZ</td>\n",
       "      <td>20200525.0</td>\n",
       "      <td>31304.942</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>002747.SZ</td>\n",
       "      <td>20200414.0</td>\n",
       "      <td>42285.525</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>300685.SZ</td>\n",
       "      <td>20200403.0</td>\n",
       "      <td>50858.522</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>603288.SH</td>\n",
       "      <td>20200214.0</td>\n",
       "      <td>239519.343</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     ts_code  trade_date      amount\n",
       "0  002350.SZ  20200525.0    8886.508\n",
       "1  002660.SZ  20200525.0   31304.942\n",
       "2  002747.SZ  20200414.0   42285.525\n",
       "3  300685.SZ  20200403.0   50858.522\n",
       "4  603288.SH  20200214.0  239519.343"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def get_second_largest(x):\n",
    "    return x.iloc[1,:]\n",
    "\n",
    "df_tmp = df.sort_values(by = ['ts_code', 'amount'], ascending = [False, True])\n",
    "#df_tmp\n",
    "df_new = df_tmp.groupby('ts_code')[['trade_date','amount']].apply(get_second_largest).reset_index()\n",
    "df_new\n",
    "#df_new['trade_date'].apply(int)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##### 作业\n",
    "\n",
    "1. 了解如何使用下列的函数：去重（df.drop_duplicates）, 去空值（df.dropna），合并（df.merge, dr.concat），分组（df.groupby）"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
